summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMark Felder <feld@feld.me>2024-07-15 10:23:03 -0400
committerMark Felder <feld@feld.me>2024-07-15 11:45:12 -0400
commit2e2caad28db9dbc7342ac706bc743ec393c2e7e4 (patch)
tree69e6860367e9907376cd02285cb0c794535fe57c
parent6278af209af00594c4d1ae37410da629e02b4df2 (diff)
downloadpleroma-2e2caad28db9dbc7342ac706bc743ec393c2e7e4.tar.gz
pleroma-2e2caad28db9dbc7342ac706bc743ec393c2e7e4.zip
Fix Oban jobs exiting with :error instead of :cancel
-rw-r--r--changelog.d/oban-cancel.change1
-rw-r--r--lib/pleroma/workers/purge_expired_activity.ex4
2 files changed, 3 insertions, 2 deletions
diff --git a/changelog.d/oban-cancel.change b/changelog.d/oban-cancel.change
new file mode 100644
index 000000000..e4512d3bb
--- /dev/null
+++ b/changelog.d/oban-cancel.change
@@ -0,0 +1 @@
+Changed some jobs to return :cancel on unrecoverable errors that should not be retried
diff --git a/lib/pleroma/workers/purge_expired_activity.ex b/lib/pleroma/workers/purge_expired_activity.ex
index a65593b6e..6b0799a14 100644
--- a/lib/pleroma/workers/purge_expired_activity.ex
+++ b/lib/pleroma/workers/purge_expired_activity.ex
@@ -46,13 +46,13 @@ defmodule Pleroma.Workers.PurgeExpiredActivity do
defp find_activity(id) do
with nil <- Activity.get_by_id_with_object(id) do
- {:error, :activity_not_found}
+ {:cancel, :activity_not_found}
end
end
defp find_user(ap_id) do
with nil <- Pleroma.User.get_by_ap_id(ap_id) do
- {:error, :user_not_found}
+ {:cancel, :user_not_found}
end
end