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

chore: refactor some code and remove obsolete variable

This commit is contained in:
Ruben Bridgewater
2017-05-28 05:21:42 +02:00
parent 39da7878d4
commit 579e080ad5
7 changed files with 62 additions and 57 deletions

View File

@@ -3,13 +3,18 @@
const tls = require('tls')
const Parser = require('redis-parser')
const net = require('net')
const reconnect = require('./reconnect')
const onConnect = require('./readyHandler')
const debug = require('./debug')
const replyHandler = require('./replyHandler')
const flushAndError = require('./flushAndError')
const onResult = replyHandler.onResult
const onError = replyHandler.onError
var reconnect = function (client, why, err) {
reconnect = require('./reconnect')
reconnect(client, why, err)
}
function onStreamError (client, err) {
if (client.closing) {
return
@@ -48,7 +53,7 @@ function createParser (client) {
// Note: the execution order is important. First flush and emit, then create the stream
err.message += '. Please report this.'
client.ready = false
client.flushAndError('Fatal error encountered. Command aborted.', 'NR_FATAL', {
flushAndError(client, 'Fatal error encountered. Command aborted.', 'NR_FATAL', {
error: err,
queues: ['commandQueue']
})