1
0
mirror of https://github.com/redis/node-redis.git synced 2025-08-09 00:22:08 +03:00
This commit is contained in:
Ruben Bridgewater
2017-05-30 05:29:51 +02:00
parent ac26d0524d
commit 31fafd8b7c
6 changed files with 31 additions and 23 deletions

View File

@@ -60,7 +60,7 @@ function createParser (client) {
connect(client)
setImmediate(() => client.emit('error', err))
},
returnBuffers: client.buffers || client.messageBuffers,
returnBuffers: client._parserReturningBuffers,
stringNumbers: client._options.stringNumbers || false
})
}

View File

@@ -19,7 +19,7 @@ function retryConnection (client, error) {
attempt: client.attempts,
error,
totalRetryTime: client.retryTotaltime,
timesConnected: client.timesConnected
timesConnected: client._timesConnected
}
client.emit('reconnecting', reconnectParams)
@@ -71,11 +71,11 @@ function reconnect (client, why, error) {
return
}
client.retryDelay = client.retryStrategy({
client.retryDelay = client._retryStrategy({
attempt: client.attempts,
error,
totalRetryTime: client.retryTotaltime,
timesConnected: client.timesConnected
timesConnected: client._timesConnected
})
if (typeof client.retryDelay !== 'number') {
var err

View File

@@ -42,7 +42,8 @@ function onResult (client, reply) {
// the average performance of all other commands in case of no monitor mode
if (client._monitoring === true) {
var replyStr
if (client.buffers && Buffer.isBuffer(reply)) {
// TODO: This could be further improved performance wise
if (client._parserReturningBuffers && Buffer.isBuffer(reply)) {
replyStr = reply.toString()
} else {
replyStr = reply

View File

@@ -141,7 +141,7 @@ function warn (client, msg) {
* @returns {string|number|null|Buffer|any[]|object}
*/
function handleReply (client, reply, command) {
if (client._options.detectBuffers === true && command.bufferArgs === false || client.messageBuffers === true) {
if (client._options.detectBuffers === true && command.bufferArgs === false || client._messageBuffers === true) {
reply = replyToStrings(reply)
}