Stream the notifications as part of the job
This commit is contained in:
parent
3211557f74
commit
dcc50da400
@ -479,8 +479,6 @@ defmodule Pleroma.Notification do
|
||||
end
|
||||
end)
|
||||
|
||||
stream(notifications)
|
||||
|
||||
{:ok, notifications}
|
||||
end
|
||||
end
|
||||
|
@ -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
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user