You've already forked node-redis
mirror of
https://github.com/redis/node-redis.git
synced 2025-08-04 15:02:09 +03:00
chore: mark private variables as such and remove obsolete ones
This commit is contained in:
@@ -11,14 +11,14 @@ function onConnect (client) {
|
||||
// fast properties. If that's not the case, make them fast properties
|
||||
// again!
|
||||
client.connected = true
|
||||
client._stream.setKeepAlive(client.options.socketKeepalive)
|
||||
client._stream.setKeepAlive(client._options.socketKeepalive)
|
||||
client._stream.setTimeout(0)
|
||||
|
||||
// TODO: Deprecate the connect event.
|
||||
client.emit('connect')
|
||||
utils.setReconnectDefaults(client)
|
||||
|
||||
if (client.options.noReadyCheck) {
|
||||
if (client._options.noReadyCheck) {
|
||||
readyHandler(client)
|
||||
} else {
|
||||
readyCheck(client)
|
||||
@@ -53,21 +53,21 @@ function readyHandler (client) {
|
||||
|
||||
if (client.selectedDb !== undefined) {
|
||||
client.internalSendCommand(new Command('select', [client.selectedDb])).catch((err) => {
|
||||
if (!client.closing) {
|
||||
if (!client._closing) {
|
||||
// TODO: These internal things should be wrapped in a
|
||||
// special error that describes what is happening
|
||||
process.nextTick(client.emit, 'error', err)
|
||||
}
|
||||
})
|
||||
}
|
||||
if (client.monitoring) { // Monitor has to be fired before pub sub commands
|
||||
if (client._monitoring) { // Monitor has to be fired before pub sub commands
|
||||
client.internalSendCommand(new Command('monitor', [])).catch((err) => {
|
||||
if (!client.closing) {
|
||||
if (!client._closing) {
|
||||
process.nextTick(client.emit, 'error', err)
|
||||
}
|
||||
})
|
||||
}
|
||||
const callbackCount = Object.keys(client.subscriptionSet).length
|
||||
const callbackCount = Object.keys(client._subscriptionSet).length
|
||||
// TODO: Replace the disableResubscribing by a individual function that may be called
|
||||
// Add HOOKS!!!
|
||||
// Replace the disableResubscribing by:
|
||||
@@ -77,14 +77,14 @@ function readyHandler (client) {
|
||||
// subscriptions: true,
|
||||
// // individual: function noop () {}
|
||||
// }
|
||||
if (!client.options.disableResubscribing && callbackCount) {
|
||||
if (!client._options.disableResubscribing && callbackCount) {
|
||||
debug('Sending pub/sub commands')
|
||||
for (const key in client.subscriptionSet) {
|
||||
if (client.subscriptionSet.hasOwnProperty(key)) {
|
||||
for (const key in client._subscriptionSet) {
|
||||
if (client._subscriptionSet.hasOwnProperty(key)) {
|
||||
const command = key.slice(0, key.indexOf('_'))
|
||||
const args = client.subscriptionSet[key]
|
||||
const args = client._subscriptionSet[key]
|
||||
client[command]([args]).catch((err) => {
|
||||
if (!client.closing) {
|
||||
if (!client._closing) {
|
||||
process.nextTick(client.emit, 'error', err)
|
||||
}
|
||||
})
|
||||
@@ -133,7 +133,7 @@ function readyCheck (client) {
|
||||
debug('Redis server still loading, trying again in %s', retryTime)
|
||||
setTimeout((client) => readyCheck(client), retryTime, client)
|
||||
}).catch((err) => {
|
||||
if (client.closing) {
|
||||
if (client._closing) {
|
||||
return
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user