Prevent publisher jobs from erroring if the connection pool is full
A full pool is a soft-error. Snooze the job for 30 seconds and try again.
This commit is contained in:
parent
ac55764599
commit
72fc41d891
|
@ -0,0 +1 @@
|
||||||
|
Connection pool errors when publishing an activity is a soft-error that will be retried shortly.
|
|
@ -129,6 +129,10 @@ def publish_one(%{inbox: inbox, json: json, actor: %User{} = actor, id: id} = pa
|
||||||
_ -> {:error, e}
|
_ -> {:error, e}
|
||||||
end
|
end
|
||||||
|
|
||||||
|
{:error, :pool_full} ->
|
||||||
|
Logger.debug("Publisher snoozing worker job due to full connection pool")
|
||||||
|
{:snooze, 30}
|
||||||
|
|
||||||
e ->
|
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)
|
Logger.metadata(activity: id, inbox: inbox)
|
||||||
|
|
Loading…
Reference in New Issue