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

Fix send_command working with hooked internal functions

This commit is contained in:
Ruben Bridgewater
2016-03-31 19:17:29 +02:00
parent 3c2e6b4a83
commit 861749f4d6
5 changed files with 21 additions and 25 deletions

View File

@@ -147,7 +147,7 @@ Multi.prototype.exec_transaction = function exec_transaction (callback) {
pipeline_transaction_command(self, command, args[1], index, cb);
}
self._client.send_command('exec', [], function (err, replies) {
self._client.internal_send_command('exec', [], function (err, replies) {
multi_callback(self, err, replies);
});
self._client.uncork();
@@ -207,10 +207,10 @@ Multi.prototype.exec = Multi.prototype.EXEC = Multi.prototype.exec_batch = funct
} else {
cb = callback_without_own_cb;
}
if (callback && index === len - 1) {
if (typeof callback === 'function' && index === len - 1) {
cb = last_callback(cb);
}
self._client.send_command(command, args[1], cb);
self._client.internal_send_command(command, args[1], cb);
index++;
}
self.queue = new Queue();