mirror of
https://github.com/knex/knex.git
synced 2025-09-23 07:04:04 +00:00
fix for #90, multiple destroy calls are successful
This commit is contained in:
parent
2ec64f6dd6
commit
f23e24c7fb
@ -80,10 +80,14 @@ define(function(require, exports) {
|
||||
// Tear down the pool, only necessary if you need it.
|
||||
destroy: function(callback) {
|
||||
var poolInstance = this.poolInstance;
|
||||
if (poolInstance) {
|
||||
poolInstance.drain(function() {
|
||||
poolInstance.destroyAllNow(callback);
|
||||
});
|
||||
delete this.poolInstance;
|
||||
} else {
|
||||
callback();
|
||||
}
|
||||
return this;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user