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

chore: improve multi performance by refactoring a array check away

This commit is contained in:
Ruben Bridgewater
2017-05-26 17:07:21 +02:00
parent f69aba72d1
commit a3a74559da
3 changed files with 25 additions and 26 deletions

View File

@@ -119,6 +119,7 @@ function RedisClient (options, stream) {
this.timesConnected = 0
this.buffers = options.returnBuffers || options.detectBuffers
this.options = options
this._multi = false
this.reply = 'ON' // Returning replies is the default
this.retryStrategy = options.retryStrategy || function (options) {
if (options.attempt > 100) {
@@ -619,7 +620,7 @@ RedisClient.prototype.returnError = function (err) {
function normalReply (self, reply) {
const commandObj = self.commandQueue.shift()
if (commandObj.command !== 'exec') {
if (self._multi === false) {
reply = self.handleReply(reply, commandObj.command, commandObj.bufferArgs)
}
commandObj.callback(null, reply)