diff --git a/lib/pleroma/gun/connections.ex b/lib/pleroma/gun/connections.ex index 78fe0bce5..695c3c93e 100644 --- a/lib/pleroma/gun/connections.ex +++ b/lib/pleroma/gun/connections.ex @@ -13,8 +13,14 @@ defmodule Pleroma.Gun.Connections do 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 - 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__, []) else :ignore