projects
/
akkoma
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Remote Timeline: add Streaming support
[akkoma]
/
lib
/
pleroma
/
gun
/
connection_pool
/
worker.ex
diff --git
a/lib/pleroma/gun/connection_pool/worker.ex
b/lib/pleroma/gun/connection_pool/worker.ex
index 49d41e4c7e62931b347469ca076c93566289b458..bf57e9e5fd9ed9c457aa4ff4c6965c9060de9c5f 100644
(file)
--- a/
lib/pleroma/gun/connection_pool/worker.ex
+++ b/
lib/pleroma/gun/connection_pool/worker.ex
@@
-93,25
+93,18
@@
defmodule Pleroma.Gun.ConnectionPool.Worker do
end)
{ref, state} = pop_in(state.client_monitors[client_pid])
end)
{ref, state} = pop_in(state.client_monitors[client_pid])
- # DOWN message can receive right after `remove_client` call and cause worker to terminate
- state =
- if is_nil(ref) do
- state
- else
- Process.demonitor(ref)
- timer =
- if used_by == [] do
- max_idle = Pleroma.Config.get([:connections_pool, :max_idle_time], 30_000)
- Process.send_after(self(), :idle_close, max_idle)
- else
- nil
- end
+ Process.demonitor(ref, [:flush])
- %{state | timer: timer}
+ timer =
+ if used_by == [] do
+ max_idle = Pleroma.Config.get([:connections_pool, :max_idle_time], 30_000)
+ Process.send_after(self(), :idle_close, max_idle)
+ else
+ nil
end
end
- {:reply, :ok,
state
, :hibernate}
+ {:reply, :ok,
%{state | timer: timer}
, :hibernate}
end
@impl true
end
@impl true