commit: dcc50da4009f19303dec36e0969f3fca0f690e4f
parent 3211557f742e07d5144426a71c39267480656a38
Author: Mark Felder <feld@feld.me>
Date: Sat, 8 Jun 2024 22:40:08 -0400
Stream the notifications as part of the job
Diffstat:
2 files changed, 3 insertions(+), 4 deletions(-)
diff --git a/lib/pleroma/notification.ex b/lib/pleroma/notification.ex
@@ -479,8 +479,6 @@ defmodule Pleroma.Notification do
end
end)
- stream(notifications)
-
{:ok, notifications}
end
end
diff --git a/lib/pleroma/workers/poll_worker.ex b/lib/pleroma/workers/poll_worker.ex
@@ -14,8 +14,9 @@ defmodule Pleroma.Workers.PollWorker do
@impl Oban.Worker
def perform(%Job{args: %{"op" => "poll_end", "activity_id" => activity_id}}) do
- with %Activity{} = activity <- find_poll_activity(activity_id) do
- Notification.create_poll_notifications(activity)
+ with %Activity{} = activity <- find_poll_activity(activity_id),
+ {:ok, notifications} <- Notification.create_poll_notifications(activity) do
+ Notification.stream(notifications)
end
end