allow new connections right away if pool can be increased

This commit is contained in:
Brian J. Cardiff 2016-10-22 19:14:18 -03:00
parent 56aa10c54d
commit 3a7c801ece
2 changed files with 13 additions and 0 deletions

View file

@ -80,6 +80,9 @@ module DB
# but if a new connection is needed there is a `retry_delay` seconds delay.
def retry
current_available = @available.size
# if the pool hasn't reach the max size, allow 1 attempt
# to make a new connection if needed without sleeping
current_available += 1 if can_increase_pool
(current_available + @retry_attempts).times do |i|
begin