Skip to content

Commit

Permalink
Clear connection timeout on error (#2015)
Browse files Browse the repository at this point in the history
Cancel the connection timeout upon stream error, to avoid getting a stream error followed later by a connection error.
  • Loading branch information
adam-nielsen authored and brianc committed Dec 12, 2019
1 parent 8f56b8c commit b03a3bd
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions lib/client.js
Expand Up @@ -251,6 +251,7 @@ Client.prototype._connect = function (callback) {
? new Error('Connection terminated')
: new Error('Connection terminated unexpectedly')

clearTimeout(connectionTimeoutHandle)
this._errorAllQueries(error)

if (!this._ending) {
Expand Down

0 comments on commit b03a3bd

Please sign in to comment.