1
0
mirror of https://github.com/redis/node-redis.git synced 2025-08-06 02:15:48 +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

@@ -2,6 +2,7 @@
const debug = require('./debug')
const Command = require('./command')
const utils = require('./utils')
function onConnect (client) {
debug('Stream connected %s id %s', client.address, client.connectionId)
@@ -10,14 +11,12 @@ function onConnect (client) {
// fast properties. If that's not the case, make them fast properties
// again!
client.connected = true
client.ready = false
client.emittedEnd = false
client._stream.setKeepAlive(client.options.socketKeepalive)
client._stream.setTimeout(0)
// TODO: Deprecate the connect event.
client.emit('connect')
client.initializeRetryVars()
utils.setReconnectDefaults(client)
if (client.options.noReadyCheck) {
readyHandler(client)