Skip to content

Commit e912b62

Browse files
authored
Merge pull request #68 from itrendtrekhunt/master
retry queries on PROTOCOL_CONNECTION_LOST error
2 parents 5a61b56 + ffc7551 commit e912b62

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,7 @@ module.exports = (params) => {
191191
client.destroy() // destroy connection on timeout
192192
resetClient() // reset the client
193193
reject(err) // reject the promise with the error
194-
} else if (err && /^PROTOCOL_ENQUEUE_AFTER_/.test(err.code)) {
194+
} else if (err && (/^PROTOCOL_ENQUEUE_AFTER_/.test(err.code) || err.code === 'PROTOCOL_CONNECTION_LOST')) {
195195
resetClient() // reset the client
196196
return resolve(query(...args)) // attempt the query again
197197
} else if (err) {

0 commit comments

Comments
 (0)