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)
stream(notifications)
{:ok, notifications}
end
end

View File

@ -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