diff --git a/lib/pool.js b/lib/pool.js index 607e2c7..5722c59 100644 --- a/lib/pool.js +++ b/lib/pool.js @@ -96,7 +96,7 @@ Pool.prototype.getConnection = function() { } if (self._slowGrowth === false) { - self._expandBuffer(); + return self._expandBuffer(); } }); @@ -245,7 +245,7 @@ Pool.prototype.createConnection = function() { // Not sure what happened here, so let's be safe and close this connection. connection.close().then(function() { - self._expandBuffer(); + return self._expandBuffer(); }).error(function(e) { // We failed to close this connection, but we removed it from the pool... so err, let's just ignore that. self._expandBuffer(); @@ -318,7 +318,7 @@ Pool.prototype._expandBuffer = function() { if ((this._draining === false) && (this._pool.getLength() < this.options.buffer+this._localhostToDrain) && (this._numConnections < this.options.max+this._localhostToDrain)) { - this.createConnection(); + return this.createConnection(); } }