Skip to content

Commit c931ee8

Browse files
committed
Remove item from the active queue on connection error
1 parent ff2013a commit c931ee8

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

lib/dialects/mysql/connector-manager.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -374,7 +374,7 @@ module.exports = (function() {
374374

375375
var dequeue = function(queueItem) {
376376
//return the item's connection to the pool
377-
if (this.pool) {
377+
if (this.pool && queueItem.client) {
378378
this.pool.release(queueItem.client)
379379
}
380380
this.activeQueue = without(this.activeQueue, queueItem)
@@ -404,6 +404,7 @@ module.exports = (function() {
404404
type: queueItem.query.options.type
405405
}, function (err, connection) {
406406
if (err) {
407+
afterQuery.call(self, queueItem)
407408
queueItem.query.emit('error', err)
408409
return
409410
}

0 commit comments

Comments
 (0)