Skip to content

Commit ffc7551

Browse files
author
Iliya Trendafilov
committed
retry queries on PROTOCOL_CONNECTION_LOST error
see #57
1 parent 5a61b56 commit ffc7551

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)