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:
Mark Felder 2024-02-22 14:11:02 -05:00
parent ac55764599
commit 72fc41d891
2 changed files with 5 additions and 0 deletions

View File

@ -0,0 +1 @@
Connection pool errors when publishing an activity is a soft-error that will be retried shortly.

View File

@ -129,6 +129,10 @@ defmodule Pleroma.Web.ActivityPub.Publisher do
_ -> {:error, e}
end
{:error, :pool_full} ->
Logger.debug("Publisher snoozing worker job due to full connection pool")
{:snooze, 30}
e ->
unless params[:unreachable_since], do: Instances.set_unreachable(inbox)
Logger.metadata(activity: id, inbox: inbox)