Apply suggestion to lib/pleroma/pool/connections.ex

This commit is contained in:
Alexander Strizhakov 2020-03-03 09:53:31 +00:00
parent a21a66972f
commit 7eb6592992

View file

@ -180,10 +180,10 @@ def handle_info({:gun_up, conn_pid, _protocol}, state) do
state = state =
with conn_key when is_binary(conn_key) <- compose_key_gun_info(conn_pid), with conn_key when is_binary(conn_key) <- compose_key_gun_info(conn_pid),
{key, conn} <- find_conn(state.conns, conn_pid, conn_key), {key, conn} <- find_conn(state.conns, conn_pid, conn_key),
{true, key} <- {Process.alive?(conn_pid), key}, {true, key} <- {Process.alive?(conn_pid), key} do
time <- :os.system_time(:second), time = :os.system_time(:second)
last_reference <- time - conn.last_reference, last_reference = time - conn.last_reference
current_crf <- crf(last_reference, 100, conn.crf) do current_crf = crf(last_reference, 100, conn.crf)
put_in(state.conns[key], %{ put_in(state.conns[key], %{
conn conn
| gun_state: :up, | gun_state: :up,