fix for gun connections pool

This commit is contained in:
Alexander Strizhakov 2020-04-08 18:46:01 +03:00
commit 5739c498c0
No known key found for this signature in database
GPG key ID: 022896A53AEF1381
2 changed files with 6 additions and 1 deletions

View file

@ -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)