summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorMark Felder <feld@feld.me>2024-02-22 14:11:02 -0500
committerMark Felder <feld@feld.me>2024-02-22 14:14:40 -0500
commit72fc41d89196dc76e6c2c1c6213e10cbaadd7d3c (patch)
treeae8f6af6f4e355641aff3fb7042832ece89ec449 /lib
parentac55764599c054a03299470d92fd0d274509a024 (diff)
downloadpleroma-72fc41d89196dc76e6c2c1c6213e10cbaadd7d3c.tar.gz
pleroma-72fc41d89196dc76e6c2c1c6213e10cbaadd7d3c.zip
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.
Diffstat (limited to 'lib')
-rw-r--r--lib/pleroma/web/activity_pub/publisher.ex4
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/pleroma/web/activity_pub/publisher.ex b/lib/pleroma/web/activity_pub/publisher.ex
index c27612697..9e7d00519 100644
--- a/lib/pleroma/web/activity_pub/publisher.ex
+++ b/lib/pleroma/web/activity_pub/publisher.ex
@@ -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)