Kaynağa Gözat

removing try block in getting gun info

debug-remote-ip
Alexander Strizhakov 4 yıl önce
ebeveyn
işleme
eb324467d9
Veri tabanında bu imza için bilinen anahtar bulunamadı GPG Anahtar Kimliği: 22896A53AEF1381
1 değiştirilmiş dosya ile 8 ekleme ve 13 silme
  1. +8
    -13
      lib/pleroma/pool/connections.ex

+ 8
- 13
lib/pleroma/pool/connections.ex Dosyayı Görüntüle

@@ -285,20 +285,15 @@ defmodule Pleroma.Pool.Connections do
end

defp compose_key_gun_info(pid) do
try do
# 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 =
case :inet.ntoa(origin_host) do
{:error, :einval} -> origin_host
ip -> ip
end
%{origin_host: origin_host, origin_scheme: scheme, origin_port: port} = Gun.info(pid)

"#{scheme}:#{host}:#{port}"
rescue
_ -> :error_gun_info
end
host =
case :inet.ntoa(origin_host) do
{:error, :einval} -> origin_host
ip -> ip
end

"#{scheme}:#{host}:#{port}"
end

defp find_conn(conns, conn_pid) do


Yükleniyor…
İptal
Kaydet