diff options
author | Mark Felder <feld@feld.me> | 2024-02-23 11:12:10 -0500 |
---|---|---|
committer | Mark Felder <feld@feld.me> | 2024-02-23 11:12:10 -0500 |
commit | f4e48bc53ee5ffeb9e7387219c0d46dc33d04521 (patch) | |
tree | 448094f924fe1349f29df6b0d0c3faa915d969e2 /lib | |
parent | 72fc41d89196dc76e6c2c1c6213e10cbaadd7d3c (diff) | |
download | pleroma-f4e48bc53ee5ffeb9e7387219c0d46dc33d04521.tar.gz pleroma-f4e48bc53ee5ffeb9e7387219c0d46dc33d04521.zip |
Rename variable to make the worker retry logic easier to read
The boolean value matches the intent of the "last_attempt" variable name now
Diffstat (limited to 'lib')
-rw-r--r-- | lib/pleroma/gun/connection_pool/worker_supervisor.ex | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/pleroma/gun/connection_pool/worker_supervisor.ex b/lib/pleroma/gun/connection_pool/worker_supervisor.ex index edaffcc25..eb83962d8 100644 --- a/lib/pleroma/gun/connection_pool/worker_supervisor.ex +++ b/lib/pleroma/gun/connection_pool/worker_supervisor.ex @@ -18,10 +18,10 @@ defmodule Pleroma.Gun.ConnectionPool.WorkerSupervisor do ) end - def start_worker(opts, retry \\ false) do + def start_worker(opts, last_attempt \\ false) do case DynamicSupervisor.start_child(__MODULE__, {Pleroma.Gun.ConnectionPool.Worker, opts}) do {:error, :max_children} -> - funs = [fn -> retry end, fn -> match?(:error, free_pool()) end] + funs = [fn -> last_attempt end, fn -> match?(:error, free_pool()) end] if Enum.any?(funs, fn fun -> fun.() end) do :telemetry.execute([:pleroma, :connection_pool, :provision_failure], %{opts: opts}) |