summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorMark Felder <feld@feld.me>2023-12-29 00:25:33 -0500
committerMark Felder <feld@feld.me>2023-12-29 00:25:33 -0500
commit7ebca7ecfa93f41d9eac2dcefa4b2e55f1b0c4ac (patch)
treec671b6b37d03f075c17e137c0ecb9656f541f028 /lib
parent77949d4590b2a82ef6bb4c79f0777962991e28b1 (diff)
downloadpleroma-7ebca7ecfa93f41d9eac2dcefa4b2e55f1b0c4ac.tar.gz
pleroma-7ebca7ecfa93f41d9eac2dcefa4b2e55f1b0c4ac.zip
Activity publishing failures will prevent the job from retrying if the publishing request returns a 403 or 410
Diffstat (limited to 'lib')
-rw-r--r--lib/pleroma/web/activity_pub/publisher.ex9
1 files changed, 7 insertions, 2 deletions
diff --git a/lib/pleroma/web/activity_pub/publisher.ex b/lib/pleroma/web/activity_pub/publisher.ex
index 103b00f11..1ce920e81 100644
--- a/lib/pleroma/web/activity_pub/publisher.ex
+++ b/lib/pleroma/web/activity_pub/publisher.ex
@@ -117,11 +117,16 @@ defmodule Pleroma.Web.ActivityPub.Publisher do
result
else
- {_post_result, response} = e ->
+ {_post_result, %{status: code} = response} = e ->
unless params[:unreachable_since], do: Instances.set_unreachable(inbox)
Logger.metadata(activity: id, inbox: inbox, status: code)
Logger.error("Publisher failed to inbox #{inbox} with status #{code}")
- {:error, response}
+
+ case response do
+ %{status: 403} -> {:discard, :forbidden}
+ %{status: 410} -> {:discard, :not_found}
+ _ -> {:error, response}
+ end
end
end