Skip to content

Commit 515d2de

Browse files
author
Anton Lakin
committed
patch pool.js to be async consistently
1 parent c76b381 commit 515d2de

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

lib/Pool.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,9 @@ Pool.prototype.getConnection = function (cb) {
2323
if (this._freeConnections.length > 0) {
2424
connection = this._freeConnections.shift();
2525

26-
return cb(null, connection);
26+
process.nextTick(function(){
27+
return cb(null, connection);
28+
});
2729
}
2830

2931
if (this.config.connectionLimit === 0 || this._allConnections.length < this.config.connectionLimit) {

0 commit comments

Comments
 (0)