commit: 03a6e33b81281256f2e9b6ffb75910fdd1a7894f
parent a3038aa6a2189ced1e5c394a4e6e8be76f2644d0
Author: Mark Felder <feld@feld.me>
Date: Wed, 9 Oct 2024 16:25:58 -0400
Skip the final refresh job if the activity is local
Diffstat:
1 file changed, 5 insertions(+), 3 deletions(-)
diff --git a/lib/pleroma/workers/poll_worker.ex b/lib/pleroma/workers/poll_worker.ex
@@ -22,9 +22,11 @@ defmodule Pleroma.Workers.PollWorker do
def perform(%Job{args: %{"op" => "poll_end", "activity_id" => activity_id}}) do
with {_, %Activity{} = activity} <- {:activity, Activity.get_by_id(activity_id)},
{:ok, notifications} <- Notification.create_poll_notifications(activity) do
- # Schedule a final refresh
- __MODULE__.new(%{"op" => "refresh", "activity_id" => activity_id})
- |> Oban.insert()
+ unless activity.local do
+ # Schedule a final refresh
+ __MODULE__.new(%{"op" => "refresh", "activity_id" => activity_id})
+ |> Oban.insert()
+ end
Notification.stream(notifications)
else