Skip to content

Commit 6633202

Browse files
committed
fixup! Add idleConnectionTimeout to pool options
Use conn.end instead of conn.destroy for closing idle connections
1 parent fc44254 commit 6633202

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

lib/PoolConnection.js

+3-1
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ var Events = require('events');
55
module.exports = PoolConnection;
66
inherits(PoolConnection, Connection);
77

8+
function _noop() {}
9+
810
function PoolConnection(pool, options) {
911
Connection.call(this, options);
1012
this._pool = pool;
@@ -34,7 +36,7 @@ PoolConnection.prototype.release = function release() {
3436

3537
if (this._pool.config.idleConnectionTimeout) {
3638
this._idleTimeout = setTimeout(
37-
this.destroy.bind(this),
39+
this._realEnd.bind(this, _noop),
3840
this._pool.config.idleConnectionTimeout
3941
);
4042
}

0 commit comments

Comments
 (0)