gun: connection pool: allow the connection pool to be started with a name when appropriate
This commit is contained in:
parent
a53a450550
commit
337340c3a1
@ -13,8 +13,14 @@ defmodule Pleroma.Gun.Connections do
|
|||||||
|
|
||||||
defstruct conns: %{}
|
defstruct conns: %{}
|
||||||
|
|
||||||
|
def start_link(name \\ __MODULE__)
|
||||||
|
|
||||||
|
def start_link(name) when is_atom(name) do
|
||||||
|
GenServer.start_link(__MODULE__, [], name: name)
|
||||||
|
end
|
||||||
|
|
||||||
def start_link(_) do
|
def start_link(_) do
|
||||||
if Application.get_env(:tesla, :adapter) == Tesla.Adapter.Gun || Mix.env() == :test do
|
if Application.get_env(:tesla, :adapter) == Tesla.Adapter.Gun do
|
||||||
GenServer.start_link(__MODULE__, [])
|
GenServer.start_link(__MODULE__, [])
|
||||||
else
|
else
|
||||||
:ignore
|
:ignore
|
||||||
|
Loading…
Reference in New Issue
Block a user