ConnectionPool.Worker: do not stop with an error when there is a timeout
This produced error log messages about GenServer termination every time the connection was not open due to a timeout. Instead we stop with `{:shutdown, <gun_error>}` since shutting down when the connection can't be established is normal behavior.
This commit is contained in:
parent
6d583bcc3b
commit
7115c5f82e
@ -53,7 +53,10 @@ defmodule Pleroma.Gun.ConnectionPool do
|
|||||||
{:ok, pid}
|
{:ok, pid}
|
||||||
|
|
||||||
{:DOWN, ^ref, :process, ^worker_pid, reason} ->
|
{:DOWN, ^ref, :process, ^worker_pid, reason} ->
|
||||||
{:error, reason}
|
case reason do
|
||||||
|
{:shutdown, error} -> error
|
||||||
|
_ -> {:error, reason}
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -31,7 +31,7 @@ defmodule Pleroma.Gun.ConnectionPool.Worker do
|
|||||||
:hibernate}
|
:hibernate}
|
||||||
else
|
else
|
||||||
err ->
|
err ->
|
||||||
{:stop, err, nil}
|
{:stop, {:shutdown, err}, nil}
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user