You've already forked node-redis
mirror of
https://github.com/redis/node-redis.git
synced 2025-08-06 02:15:48 +03:00
chore: refactor main code into smaller parts
This commit is contained in:
@@ -22,6 +22,14 @@ function onConnect (client) {
|
||||
}
|
||||
}
|
||||
|
||||
function sendOfflineQueue (client) {
|
||||
while (client.offlineQueue.length) {
|
||||
const command = client.offlineQueue.shift()
|
||||
debug('Sending offline command: %s', command.command)
|
||||
client.internalSendCommand(command)
|
||||
}
|
||||
}
|
||||
|
||||
function onReady (client) {
|
||||
debug('onReady called %s id %s', client.address, client.connectionId)
|
||||
client.ready = true
|
||||
@@ -83,7 +91,7 @@ function onReady (client) {
|
||||
}
|
||||
}
|
||||
}
|
||||
client.sendOfflineQueue()
|
||||
sendOfflineQueue(client)
|
||||
client.emit('ready')
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user