Activity publishing failures will prevent the job from retrying if the publishing request returns a 403 or 410
This commit is contained in:
parent
77949d4590
commit
7ebca7ecfa
1
changelog.d/publisher_discard.change
Normal file
1
changelog.d/publisher_discard.change
Normal file
@ -0,0 +1 @@
|
||||
Activity publishing failures will prevent the job from retrying if the publishing request returns a 403 or 410
|
@ -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
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user