Skip to content

Commit

Permalink
Destroy/end connections removed from the pool on error
Browse files Browse the repository at this point in the history
fixes #1072
  • Loading branch information
dougwilson committed May 4, 2015
1 parent 55f132c commit 275473a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions Changes.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ you spot any mistakes.

## HEAD

* Destroy/end connections removed from the pool on error
* Delay implied connect until after `.query` argument validation
* Do not remove connections with non-fatal errors from the pool
* Error early if `callback` argument to `.query` is not a function #1060
Expand Down
4 changes: 2 additions & 2 deletions lib/PoolConnection.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,13 +54,13 @@ PoolConnection.prototype.destroy = function () {
return Connection.prototype.destroy.apply(this, arguments);
};

PoolConnection.prototype._removeFromPool = function(connection) {
PoolConnection.prototype._removeFromPool = function _removeFromPool() {
if (!this._pool || this._pool._closed) {
return;
}

var pool = this._pool;
this._pool = null;

pool._removeConnection(this);
pool._purgeConnection(this);
};

0 comments on commit 275473a

Please sign in to comment.