removing try block in getting gun info
This commit is contained in:
parent
b34bc669b9
commit
eb324467d9
@ -285,20 +285,15 @@ defmodule Pleroma.Pool.Connections do
|
|||||||
end
|
end
|
||||||
|
|
||||||
defp compose_key_gun_info(pid) do
|
defp compose_key_gun_info(pid) do
|
||||||
try do
|
%{origin_host: origin_host, origin_scheme: scheme, origin_port: port} = Gun.info(pid)
|
||||||
# sometimes :gun.info can raise MatchError, which lead to pool terminate
|
|
||||||
%{origin_host: origin_host, origin_scheme: scheme, origin_port: port} = Gun.info(pid)
|
|
||||||
|
|
||||||
host =
|
host =
|
||||||
case :inet.ntoa(origin_host) do
|
case :inet.ntoa(origin_host) do
|
||||||
{:error, :einval} -> origin_host
|
{:error, :einval} -> origin_host
|
||||||
ip -> ip
|
ip -> ip
|
||||||
end
|
end
|
||||||
|
|
||||||
"#{scheme}:#{host}:#{port}"
|
"#{scheme}:#{host}:#{port}"
|
||||||
rescue
|
|
||||||
_ -> :error_gun_info
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
|
||||||
defp find_conn(conns, conn_pid) do
|
defp find_conn(conns, conn_pid) do
|
||||||
|
Loading…
Reference in New Issue
Block a user