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

Fire the individual original callbacks when using transactions

Fixes #1089
This commit is contained in:
Ruben Bridgewater
2016-06-16 12:03:47 +02:00
parent ed57f440c7
commit de0a9628aa
3 changed files with 10 additions and 0 deletions

View File

@@ -1,6 +1,12 @@
Changelog Changelog
========= =========
## v.2.6.2 - 16 Jun, 2016
Bugfixes
- Fixed individual callbacks of a transaction not being called (2.6.0 regression)
## v.2.6.1 - 02 Jun, 2016 ## v.2.6.1 - 02 Jun, 2016
Bugfixes Bugfixes

View File

@@ -36,6 +36,7 @@ function pipeline_transaction_command (self, command_obj, index) {
// Keep track of who wants buffer responses: // Keep track of who wants buffer responses:
// By the time the callback is called the command_obj got the buffer_args attribute attached // By the time the callback is called the command_obj got the buffer_args attribute attached
self.wants_buffers[index] = command_obj.buffer_args; self.wants_buffers[index] = command_obj.buffer_args;
command_obj.callback = tmp;
}; };
self._client.internal_send_command(command_obj); self._client.internal_send_command(command_obj);
} }

View File

@@ -393,6 +393,7 @@ describe("The 'multi' method", function () {
var arr2 = ['some manner of key', 'otherTypes']; var arr2 = ['some manner of key', 'otherTypes'];
var arr3 = [5768, 'multibarx', 'multifoox']; var arr3 = [5768, 'multibarx', 'multifoox'];
var arr4 = ['mset', [578, 'multibar'], helper.isString('OK')]; var arr4 = ['mset', [578, 'multibar'], helper.isString('OK')];
var called = false;
client.multi([ client.multi([
arr4, arr4,
[['mset', 'multifoo2', 'multibar2', 'multifoo3', 'multibar3'], helper.isString('OK')], [['mset', 'multifoo2', 'multibar2', 'multifoo3', 'multibar3'], helper.isString('OK')],
@@ -411,8 +412,10 @@ describe("The 'multi' method", function () {
.mget('multifoo2', ['multifoo3', 'multifoo'], function (err, res) { .mget('multifoo2', ['multifoo3', 'multifoo'], function (err, res) {
assert(res[0], 'multifoo3'); assert(res[0], 'multifoo3');
assert(res[1], 'multifoo'); assert(res[1], 'multifoo');
called = true;
}) })
.exec(function (err, replies) { .exec(function (err, replies) {
assert(called);
assert.equal(arr.length, 3); assert.equal(arr.length, 3);
assert.equal(arr2.length, 2); assert.equal(arr2.length, 2);
assert.equal(arr3.length, 3); assert.equal(arr3.length, 3);