不要怂,就是干,撸起袖子干!

Commit 5c43e53b by Dejan Ranisavljevic

Move read/write destroyAllNow to pool.

1 parent a16db0c2
Showing with 5 additions and 3 deletions
...@@ -48,9 +48,7 @@ ConnectionManager.prototype.onProcessExit = function() { ...@@ -48,9 +48,7 @@ ConnectionManager.prototype.onProcessExit = function() {
if (this.pool) { if (this.pool) {
this.pool.drain(function() { this.pool.drain(function() {
if (self.pool.destroyAllNow) self.pool.destroyAllNow(); self.pool.destroyAllNow();
if (self.pool.read && self.pool.read.destroyAllNow) self.pool.read.destroyAllNow();
if (self.pool.write && self.pool.write.destroyAllNow) self.pool.write.destroyAllNow();
}); });
} }
}; };
...@@ -122,6 +120,10 @@ ConnectionManager.prototype.initPools = function () { ...@@ -122,6 +120,10 @@ ConnectionManager.prototype.initPools = function () {
destroy: function(connection) { destroy: function(connection) {
return self.pool[connection.queryType].destroy(connection); return self.pool[connection.queryType].destroy(connection);
}, },
destroyAllNow: function() {
self.pool.read.destroyAllNow();
self.pool.write.destroyAllNow();
},
drain: function(cb) { drain: function(cb) {
self.pool.write.drain(function() { self.pool.write.drain(function() {
self.pool.read.drain(cb); self.pool.read.drain(cb);
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!