1
0
mirror of https://github.com/redis/node-redis.git synced 2025-08-06 02:15:48 +03:00

chore: minor refactoring

This commit is contained in:
Ruben Bridgewater
2017-05-30 00:44:57 +02:00
parent 0276e15f04
commit 265ce48af4
6 changed files with 50 additions and 40 deletions

View File

@@ -51,16 +51,16 @@ function reconnect (client, why, error) {
client.emit('end')
if (why === 'timeout') {
var message = 'Redis connection in broken state: connection timeout exceeded.'
const err = new Errors.RedisError(message)
// TODO: Find better error codes...
err.code = 'CONNECTION_BROKEN'
flushAndError(client, message, 'CONNECTION_BROKEN')
client.emit('error', err)
client.end(false)
return
}
// if (why === 'timeout') {
// var message = 'Redis connection in broken state: connection timeout exceeded.'
// const err = new Errors.RedisError(message)
// // TODO: Find better error codes...
// err.code = 'CONNECTION_BROKEN'
// flushAndError(client, message, 'CONNECTION_BROKEN')
// client.emit('error', err)
// client.end(false)
// return
// }
// If client is a requested shutdown, then don't retry
if (client._closing) {