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
|
@ -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 @@ def publish_one(%{inbox: inbox, json: json, actor: %User{} = actor, id: id} = pa
|
||||||
|
|
||||||
result
|
result
|
||||||
else
|
else
|
||||||
{_post_result, response} = e ->
|
{_post_result, %{status: code} = response} = e ->
|
||||||
unless params[:unreachable_since], do: Instances.set_unreachable(inbox)
|
unless params[:unreachable_since], do: Instances.set_unreachable(inbox)
|
||||||
Logger.metadata(activity: id, inbox: inbox, status: code)
|
Logger.metadata(activity: id, inbox: inbox, status: code)
|
||||||
Logger.error("Publisher failed to inbox #{inbox} with 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
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue