Skip to content

Commit

Permalink
Merge pull request #68 from itrendtrekhunt/master
Browse files Browse the repository at this point in the history
retry queries on PROTOCOL_CONNECTION_LOST error
  • Loading branch information
jeremydaly authored Jan 31, 2020
2 parents 5a61b56 + ffc7551 commit e912b62
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ module.exports = (params) => {
client.destroy() // destroy connection on timeout
resetClient() // reset the client
reject(err) // reject the promise with the error
} else if (err && /^PROTOCOL_ENQUEUE_AFTER_/.test(err.code)) {
} else if (err && (/^PROTOCOL_ENQUEUE_AFTER_/.test(err.code) || err.code === 'PROTOCOL_CONNECTION_LOST')) {
resetClient() // reset the client
return resolve(query(...args)) // attempt the query again
} else if (err) {
Expand Down

0 comments on commit e912b62

Please sign in to comment.