naming
authorAlexander Strizhakov <alex.strizhakov@gmail.com>
Tue, 3 Mar 2020 13:08:21 +0000 (16:08 +0300)
committerAlexander Strizhakov <alex.strizhakov@gmail.com>
Tue, 3 Mar 2020 13:42:24 +0000 (16:42 +0300)
lib/pleroma/gun/conn.ex

index a33d75558754c5625cebb4017edf0d5c30798425..a8b8c92c15e2995260f6d8032bc3814e95d818b0 100644 (file)
@@ -54,7 +54,7 @@ defmodule Pleroma.Gun.Conn do
       if Connections.count(name) < opts[:max_connection] do
         do_open(uri, opts)
       else
-        try_do_open(name, uri, opts)
+        close_least_used_and_do_open(name, uri, opts)
       end
 
     if is_pid(conn_pid) do
@@ -159,7 +159,7 @@ defmodule Pleroma.Gun.Conn do
 
   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)}")
 
     with [{close_key, least_used} | _conns] <-