Must always clear the timeout for handling 'acquireConnectionTimeout', even if an error occurs. Fixes #1973 (#1974)

This commit is contained in:
wubzz 2017-03-15 22:43:37 +01:00 committed by GitHub
parent b722753ea3
commit 10a6505bec

View File

@ -239,10 +239,10 @@ assign(Client.prototype, {
))
}, this.config.acquireConnectionTimeout || 60000)
this.pool.acquire((err, connection) => {
clearTimeout(t)
if (err) {
return rejecter(err)
}
clearTimeout(t)
if (wasRejected) {
this.pool.release(connection)
} else {