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?
|
resource = if @idle.empty?
|
||||||
if can_increase_pool?
|
if can_increase_pool?
|
||||||
@inflight += 1
|
@inflight += 1
|
||||||
r = unsync { build_resource }
|
begin
|
||||||
@inflight -= 1
|
r = unsync { build_resource }
|
||||||
|
ensure
|
||||||
|
@inflight -= 1
|
||||||
|
end
|
||||||
r
|
r
|
||||||
else
|
else
|
||||||
unsync { wait_for_available }
|
unsync { wait_for_available }
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue