Skip to content

Commit 85c28e9

Browse files
author
Ricky Ng-Adam
committed
destroyAllNow also has a callback
1 parent 382d6d6 commit 85c28e9

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

lib/index.js

+6-5
Original file line numberDiff line numberDiff line change
@@ -25,11 +25,12 @@ PG.prototype.end = function() {
2525
var pool = self.pools.all[key];
2626
delete self.pools.all[key];
2727
pool.drain(function() {
28-
pool.destroyAllNow();
29-
count--;
30-
if(count === 0) {
31-
self.emit('ended');
32-
}
28+
pool.destroyAllNow(function() {
29+
count--;
30+
if(count === 0) {
31+
self.emit('ended');
32+
}
33+
});
3334
});
3435
});
3536
};

0 commit comments

Comments
 (0)