mirror of
https://akkoma.dev/AkkomaGang/akkoma.git
synced 2024-11-18 02:49:18 +00:00
hackney pool timeout
This commit is contained in:
parent
6806df80dd
commit
f604f9e470
|
@ -33,8 +33,14 @@ def options(%URI{} = uri, opts \\ []) do
|
|||
end
|
||||
|
||||
defp pool_timeout(opts) do
|
||||
timeout =
|
||||
Config.get([:pools, opts[:pool], :timeout]) || Config.get([:pools, :default, :timeout])
|
||||
{config_key, default} =
|
||||
if Application.get_env(:tesla, :adapter) == Tesla.Adapter.Gun do
|
||||
{:pools, Config.get([:pools, :default, :timeout])}
|
||||
else
|
||||
{:hackney_pools, 10_000}
|
||||
end
|
||||
|
||||
timeout = Config.get([config_key, opts[:pool], :timeout], default)
|
||||
|
||||
Keyword.merge(opts, timeout: timeout)
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue