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

Commit 342e3f00 by Mick Hansen

Merge pull request #2442 from chornyi/1.7.0

Remove item from the active queue on connection error
2 parents ff2013a5 b76da6c1
Showing with 2 additions and 1 deletions
...@@ -374,7 +374,7 @@ module.exports = (function() { ...@@ -374,7 +374,7 @@ module.exports = (function() {
var dequeue = function(queueItem) { var dequeue = function(queueItem) {
//return the item's connection to the pool //return the item's connection to the pool
if (this.pool) { if (this.pool && queueItem.client) {
this.pool.release(queueItem.client) this.pool.release(queueItem.client)
} }
this.activeQueue = without(this.activeQueue, queueItem) this.activeQueue = without(this.activeQueue, queueItem)
...@@ -404,6 +404,7 @@ module.exports = (function() { ...@@ -404,6 +404,7 @@ module.exports = (function() {
type: queueItem.query.options.type type: queueItem.query.options.type
}, function (err, connection) { }, function (err, connection) {
if (err) { if (err) {
afterQuery.call(self, queueItem)
queueItem.query.emit('error', err) queueItem.query.emit('error', err)
return return
} }
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!