diff options
author | feld <feld@feld.me> | 2020-04-08 17:13:54 +0000 |
---|---|---|
committer | feld <feld@feld.me> | 2020-04-08 17:13:54 +0000 |
commit | 90cbf55236d93383af56364947432b04aafc525d (patch) | |
tree | fa8a4785c7261ef5e8baa4cde88caef7d4792f4f /lib | |
parent | dd4d10b275e76afc029aea642ae3d69b07e33d81 (diff) | |
parent | 5739c498c029914c446656244cdd213a3e358fec (diff) | |
download | pleroma-90cbf55236d93383af56364947432b04aafc525d.tar.gz |
Merge branch 'gun-pool-fix' into 'develop'
Fix for gun connections pool
Closes #1669 and #1664
See merge request pleroma/pleroma!2356
Diffstat (limited to 'lib')
-rw-r--r-- | lib/pleroma/gun/conn.ex | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/pleroma/gun/conn.ex b/lib/pleroma/gun/conn.ex index 20823a765..cd25a2e74 100644 --- a/lib/pleroma/gun/conn.ex +++ b/lib/pleroma/gun/conn.ex @@ -49,8 +49,10 @@ defmodule Pleroma.Gun.Conn do key = "#{uri.scheme}:#{uri.host}:#{uri.port}" + max_connections = pool_opts[:max_connections] || 250 + conn_pid = - if Connections.count(name) < opts[:max_connection] do + if Connections.count(name) < max_connections do do_open(uri, opts) else close_least_used_and_do_open(name, uri, opts) |