Decrement the inflight counter on ConnectionRefused (#184)
This commit is contained in:
parent
851091e81c
commit
ce95cd2257
|
@ -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…
Reference in New Issue