From b8503f1ad412df72af2dc2d975d29e8810143667 Mon Sep 17 00:00:00 2001 From: Mark Felder Date: Sat, 20 Jul 2024 21:24:13 -0400 Subject: [PATCH] PollWorker jobs will not retry if the activity no longer exists. --- changelog.d/oban-cancel-poll-result.change | 1 + lib/pleroma/workers/poll_worker.ex | 3 +++ 2 files changed, 4 insertions(+) create mode 100644 changelog.d/oban-cancel-poll-result.change diff --git a/changelog.d/oban-cancel-poll-result.change b/changelog.d/oban-cancel-poll-result.change new file mode 100644 index 000000000..b51c460a7 --- /dev/null +++ b/changelog.d/oban-cancel-poll-result.change @@ -0,0 +1 @@ +PollWorker jobs will not retry if the activity no longer exists. diff --git a/lib/pleroma/workers/poll_worker.ex b/lib/pleroma/workers/poll_worker.ex index 3fcac9bc3..af8997e70 100644 --- a/lib/pleroma/workers/poll_worker.ex +++ b/lib/pleroma/workers/poll_worker.ex @@ -17,6 +17,9 @@ defmodule Pleroma.Workers.PollWorker do with %Activity{} = activity <- find_poll_activity(activity_id), {:ok, notifications} <- Notification.create_poll_notifications(activity) do Notification.stream(notifications) + else + {:error, :poll_activity_not_found} = e -> {:cancel, e} + e -> {:error, e} end end