mirror of
https://gitea.invidious.io/iv-org/shard-crystal-db.git
synced 2024-08-15 00:53:32 +00:00
allow new connections right away if pool can be increased
This commit is contained in:
parent
56aa10c54d
commit
3a7c801ece
2 changed files with 13 additions and 0 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue