summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--changelog.d/oban-cancel-poll-result.change1
-rw-r--r--lib/pleroma/workers/poll_worker.ex3
2 files changed, 4 insertions, 0 deletions
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