mirror of
https://gitea.invidious.io/iv-org/shard-crystal-db.git
synced 2024-08-15 00:53:32 +00:00
Decrement the inflight counter on ConnectionRefused (#184)
This commit is contained in:
parent
851091e81c
commit
ce95cd2257
1 changed files with 5 additions and 2 deletions
|
@ -120,8 +120,11 @@ module DB
|
|||
resource = if @idle.empty?
|
||||
if can_increase_pool?
|
||||
@inflight += 1
|
||||
r = unsync { build_resource }
|
||||
@inflight -= 1
|
||||
begin
|
||||
r = unsync { build_resource }
|
||||
ensure
|
||||
@inflight -= 1
|
||||
end
|
||||
r
|
||||
else
|
||||
unsync { wait_for_available }
|
||||
|
|
Loading…
Reference in a new issue