projects
/
akkoma
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
fffbcff
)
Connection pool: check that there actually is a result
author
rinpatch
<rinpatch@sdf.org>
Wed, 6 May 2020 18:51:10 +0000
(21:51 +0300)
committer
rinpatch
<rinpatch@sdf.org>
Wed, 15 Jul 2020 12:17:27 +0000
(15:17 +0300)
Sometimes connections died before being released to the pool, resulting
in MatchErrors
lib/pleroma/gun/connection_pool.ex
patch
|
blob
|
history
diff --git
a/lib/pleroma/gun/connection_pool.ex
b/lib/pleroma/gun/connection_pool.ex
index ed7ddff81102217dea51c297982356d063b2d406..0daf1da44bfed3dd2ec5bf6f12bf8dc0b9253cdd 100644
(file)
--- a/
lib/pleroma/gun/connection_pool.ex
+++ b/
lib/pleroma/gun/connection_pool.ex
@@
-119,11
+119,17
@@
defmodule Pleroma.Gun.ConnectionPool do
end
def release_conn(conn_pid) do
-
[worker_pid]
=
+
query_result
=
Registry.select(@registry, [
{{:_, :"$1", {:"$2", :_, :_, :_}}, [{:==, :"$2", conn_pid}], [:"$1"]}
])
- GenServer.cast(worker_pid, {:remove_client, self()})
+ case query_result do
+ [worker_pid] ->
+ GenServer.cast(worker_pid, {:remove_client, self()})
+
+ [] ->
+ :ok
+ end
end
end