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
|
||||||
end)
|
end)
|
||||||
|
|
||||||
stream(notifications)
|
|
||||||
|
|
||||||
{:ok, notifications}
|
{:ok, notifications}
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
@ -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
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user