Fix Oban jobs exiting with :error instead of :cancel

This commit is contained in:
Mark Felder 2024-07-15 10:23:03 -04:00
parent 6278af209a
commit 2e2caad28d
2 changed files with 3 additions and 2 deletions

View File

@ -0,0 +1 @@
Changed some jobs to return :cancel on unrecoverable errors that should not be retried

View File

@ -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