This commit is contained in:
Alexander Strizhakov 2020-03-03 16:08:21 +03:00
parent e605e79df9
commit 7d68924e4f
No known key found for this signature in database
GPG Key ID: 022896A53AEF1381
1 changed files with 2 additions and 2 deletions

View File

@ -54,7 +54,7 @@ def open(%URI{} = uri, name, opts) do
if Connections.count(name) < opts[:max_connection] do if Connections.count(name) < opts[:max_connection] do
do_open(uri, opts) do_open(uri, opts)
else else
try_do_open(name, uri, opts) close_least_used_and_do_open(name, uri, opts)
end end
if is_pid(conn_pid) do if is_pid(conn_pid) do
@ -159,7 +159,7 @@ defp add_http2_opts(opts, "https", tls_opts) do
defp add_http2_opts(opts, _, _), do: opts defp add_http2_opts(opts, _, _), do: opts
defp try_do_open(name, uri, opts) do defp close_least_used_and_do_open(name, uri, opts) do
Logger.debug("try to open conn #{Connections.compose_uri_log(uri)}") Logger.debug("try to open conn #{Connections.compose_uri_log(uri)}")
with [{close_key, least_used} | _conns] <- with [{close_key, least_used} | _conns] <-