Skip to content
Snippets Groups Projects
Commit 9b73c35c authored by rinpatch's avatar rinpatch
Browse files

Request limiter setup: consider {:error, :existing} a success

When the application restarts (which happens after certain config
changes), the limiters are not destroyed, so `ConcurrentLimiter.new`
will produce {:error, :existing}
parent 12fa5541
No related branches found
No related tags found
No related merge requests found
......@@ -88,11 +88,17 @@ def limiter_setup do
max_running = Keyword.get(opts, :size, 50)
max_waiting = Keyword.get(opts, :max_waiting, 10)
:ok =
result =
ConcurrentLimiter.new(:"#{@prefix}.#{name}", max_running, max_waiting,
wait: wait,
max_retries: retries
)
case result do
:ok -> :ok
{:error, :existing} -> :ok
e -> raise e
end
end)
:ok
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment