diff options
author | Mark Felder <feld@feld.me> | 2023-12-29 00:25:33 -0500 |
---|---|---|
committer | Mark Felder <feld@feld.me> | 2023-12-29 00:25:33 -0500 |
commit | 7ebca7ecfa93f41d9eac2dcefa4b2e55f1b0c4ac (patch) | |
tree | c671b6b37d03f075c17e137c0ecb9656f541f028 | |
parent | 77949d4590b2a82ef6bb4c79f0777962991e28b1 (diff) | |
download | pleroma-7ebca7ecfa93f41d9eac2dcefa4b2e55f1b0c4ac.tar.gz pleroma-7ebca7ecfa93f41d9eac2dcefa4b2e55f1b0c4ac.zip |
Activity publishing failures will prevent the job from retrying if the publishing request returns a 403 or 410
-rw-r--r-- | changelog.d/publisher_discard.change | 1 | ||||
-rw-r--r-- | lib/pleroma/web/activity_pub/publisher.ex | 9 |
2 files changed, 8 insertions, 2 deletions
diff --git a/changelog.d/publisher_discard.change b/changelog.d/publisher_discard.change new file mode 100644 index 000000000..85e530d8d --- /dev/null +++ b/changelog.d/publisher_discard.change @@ -0,0 +1 @@ +Activity publishing failures will prevent the job from retrying if the publishing request returns a 403 or 410 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 |