Skip to content

Commit 9a2d725

Browse files
author
Cody Lundquist
committed
Add return statements for promises to fix Bluebird errors.
Fixes: #285
1 parent d6f55dd commit 9a2d725

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

lib/pool.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ Pool.prototype.getConnection = function() {
9696
}
9797

9898
if (self._slowGrowth === false) {
99-
self._expandBuffer();
99+
return self._expandBuffer();
100100
}
101101

102102
});
@@ -245,7 +245,7 @@ Pool.prototype.createConnection = function() {
245245

246246
// Not sure what happened here, so let's be safe and close this connection.
247247
connection.close().then(function() {
248-
self._expandBuffer();
248+
return self._expandBuffer();
249249
}).error(function(e) {
250250
// We failed to close this connection, but we removed it from the pool... so err, let's just ignore that.
251251
self._expandBuffer();
@@ -318,7 +318,7 @@ Pool.prototype._expandBuffer = function() {
318318
if ((this._draining === false) &&
319319
(this._pool.getLength() < this.options.buffer+this._localhostToDrain) &&
320320
(this._numConnections < this.options.max+this._localhostToDrain)) {
321-
this.createConnection();
321+
return this.createConnection();
322322
}
323323
}
324324

0 commit comments

Comments
 (0)