Skip to content

Commit 7d4358e

Browse files
committed
Fixing the count
1 parent db15b1e commit 7d4358e

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

packages/bolt-connection/src/pool/pool.js

+1
Original file line numberDiff line numberDiff line change
@@ -309,6 +309,7 @@ class Pool {
309309
}
310310
poolState.close()
311311
delete this._pools[key]
312+
delete this._activeResourceCounts[key]
312313
delete this._poolState[key]
313314
}
314315

packages/bolt-connection/test/pool/pool.test.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,7 @@ describe('#unit Pool', () => {
198198

199199
await pool.purge(address1)
200200

201-
expect(pool.activeResourceCount(address1)).toEqual(1)
201+
expect(pool.activeResourceCount(address1)).toEqual(0)
202202

203203
await r01.close()
204204

@@ -257,6 +257,7 @@ describe('#unit Pool', () => {
257257
// Purging the key
258258
await pool.purge(address)
259259
expect(pool.has(address)).toBeFalsy()
260+
expect(pool.activeResourceCount(address)).toBe(0)
260261
expect(r0.destroyed).toBeFalsy()
261262

262263
// Acquiring second resolve should recreate the pool

0 commit comments

Comments
 (0)