diff --git a/lib/PoolConnection.js b/lib/PoolConnection.js index d4464943e..f3924aac6 100644 --- a/lib/PoolConnection.js +++ b/lib/PoolConnection.js @@ -5,6 +5,8 @@ var Events = require('events'); module.exports = PoolConnection; inherits(PoolConnection, Connection); +function _noop() {} + function PoolConnection(pool, options) { Connection.call(this, options); this._pool = pool; @@ -34,7 +36,7 @@ PoolConnection.prototype.release = function release() { if (this._pool.config.idleConnectionTimeout) { this._idleTimeout = setTimeout( - this.destroy.bind(this), + this._realEnd.bind(this, _noop), this._pool.config.idleConnectionTimeout ); }