Skip to content

Commit 18a44f6

Browse files
authored
fix: The removeIdleTimeoutConnectionsTimer did not clean up when the … (#2384)
* fix: The removeIdleTimeoutConnectionsTimer did not clean up when the pool was closed. * test: when the pool is closed, it should clean up timers.
1 parent ba8fafb commit 18a44f6

File tree

2 files changed

+1
-1
lines changed

2 files changed

+1
-1
lines changed

lib/pool.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,7 @@ class Pool extends EventEmitter {
100100

101101
end(cb) {
102102
this._closed = true;
103+
clearTimeout(this._removeIdleTimeoutConnectionsTimer);
103104
if (typeof cb !== 'function') {
104105
cb = function(err) {
105106
if (err) {

test/integration/test-pool-release-idle-connection.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,6 @@ pool.getConnection((err1, connection1) => {
3838
connection4.release();
3939
connection4.destroy();
4040
pool.end();
41-
setTimeout(() => process.exit(0), 1000);
4241
});
4342
}, 7000);
4443
});

0 commit comments

Comments
 (0)