X-Git-Url: http://git.squeep.com/?a=blobdiff_plain;f=lib%2Fpleroma%2Fgun%2Fconnection_pool%2Fworker.ex;h=fec9d0efa9daa0323a02e26159c491e00313424d;hb=f671d7e68c77e5d41dd0716f48f387561efc3999;hp=a61892c60aa384ecc89a0d5247506e72eb38b81e;hpb=f462f1c101b1a82cbe633a55368b04582e4fcbd4;p=akkoma diff --git a/lib/pleroma/gun/connection_pool/worker.ex b/lib/pleroma/gun/connection_pool/worker.ex index a61892c60..fec9d0efa 100644 --- a/lib/pleroma/gun/connection_pool/worker.ex +++ b/lib/pleroma/gun/connection_pool/worker.ex @@ -36,10 +36,18 @@ defmodule Pleroma.Gun.ConnectionPool.Worker do end @impl true - def handle_cast({:add_client, client_pid, send}, state) do + def handle_cast({:add_client, client_pid}, state) do case handle_call(:add_client, {client_pid, nil}, state) do {:reply, conn_pid, state, :hibernate} -> - if send, do: send(client_pid, {:conn_pid, conn_pid}) + send(client_pid, {:conn_pid, conn_pid}) + {:noreply, state, :hibernate} + end + end + + @impl true + def handle_cast({:remove_client, client_pid}, state) do + case handle_call(:remove_client, {client_pid, nil}, state) do + {:reply, _, state, :hibernate} -> {:noreply, state, :hibernate} end end @@ -115,7 +123,7 @@ defmodule Pleroma.Gun.ConnectionPool.Worker do %{key: state.key} ) - handle_cast({:remove_client, pid, false}, state) + handle_cast({:remove_client, pid}, state) end # LRFU policy: https://citeseerx.ist.psu.edu/viewdoc/summary?doi=10.1.1.55.1478