Stream the notifications as part of the job

This commit is contained in:
Mark Felder 2024-06-08 22:40:08 -04:00
parent 3211557f74
commit dcc50da400
2 changed files with 3 additions and 4 deletions

View File

@ -479,8 +479,6 @@ defmodule Pleroma.Notification do
end end
end) end)
stream(notifications)
{:ok, notifications} {:ok, notifications}
end end
end end

View File

@ -14,8 +14,9 @@ defmodule Pleroma.Workers.PollWorker do
@impl Oban.Worker @impl Oban.Worker
def perform(%Job{args: %{"op" => "poll_end", "activity_id" => activity_id}}) do def perform(%Job{args: %{"op" => "poll_end", "activity_id" => activity_id}}) do
with %Activity{} = activity <- find_poll_activity(activity_id) do with %Activity{} = activity <- find_poll_activity(activity_id),
Notification.create_poll_notifications(activity) {:ok, notifications} <- Notification.create_poll_notifications(activity) do
Notification.stream(notifications)
end end
end end