You've already forked node-redis
mirror of
https://github.com/redis/node-redis.git
synced 2025-08-06 02:15:48 +03:00
Fix for null MULTI response when WATCH condition fails.
This commit is contained in:
@@ -420,6 +420,7 @@ In order of first contribution, they are:
|
||||
* [Orion Henry](http://github.com/orionz)
|
||||
* [Hank Sims](http://github.com/hanksims)
|
||||
* [Aivo Paas](http://github.com/aivopaas)
|
||||
* [Paul Carey](https://github.com/paulcarey)
|
||||
|
||||
Thanks.
|
||||
|
||||
|
@@ -1,6 +1,10 @@
|
||||
Changelog
|
||||
=========
|
||||
|
||||
## v0.3.8 - November 10, 2010
|
||||
|
||||
Fix for null MULTI response when WATCH condition fails.
|
||||
|
||||
## v0.3.7 - November 9, 2010
|
||||
|
||||
Add "drain" and "idle" events.
|
||||
|
@@ -1,5 +1,5 @@
|
||||
{ "name" : "redis",
|
||||
"version" : "0.3.7",
|
||||
"version" : "0.3.8",
|
||||
"description" : "Redis client library",
|
||||
"author": "Matt Ranney <mjr@ranney.com>",
|
||||
"contributors": [
|
||||
@@ -8,7 +8,8 @@
|
||||
"TJ Holowaychuk",
|
||||
"Orion Henry",
|
||||
"Hank Sims",
|
||||
"Aivo Paas"
|
||||
"Aivo Paas",
|
||||
"Paul Carey"
|
||||
],
|
||||
"main": "./index.js",
|
||||
"scripts": {
|
||||
|
29
test.js
29
test.js
@@ -6,7 +6,10 @@ var redis = require("./index"),
|
||||
assert = require("assert"),
|
||||
util,
|
||||
test_db_num = 15, // this DB will be flushed and used for testing
|
||||
tests = {};
|
||||
tests = {},
|
||||
connected = false,
|
||||
ended = false,
|
||||
server_info;
|
||||
|
||||
try {
|
||||
util = require("util");
|
||||
@@ -207,6 +210,7 @@ tests.MULTI_6 = function () {
|
||||
tests.WATCH_MULTI = function () {
|
||||
var name = 'WATCH_MULTI';
|
||||
|
||||
if (server_info.versions[0] >= 2 && server_info.versions[1] >= 1) {
|
||||
client.watch(name);
|
||||
var multi = client.multi();
|
||||
multi.incr(name);
|
||||
@@ -214,6 +218,10 @@ tests.WATCH_MULTI = function () {
|
||||
multi.exec(function (err, replies) {
|
||||
next(name);
|
||||
});
|
||||
} else {
|
||||
console.log("Skipping " + name + " because server version isn't new enough.");
|
||||
next(name);
|
||||
}
|
||||
};
|
||||
|
||||
tests.HSET = function () {
|
||||
@@ -991,11 +999,24 @@ function run_next_test() {
|
||||
}
|
||||
}
|
||||
|
||||
var connected = false;
|
||||
var ended = false;
|
||||
client.on("connect", function () {
|
||||
// Fetch and stash info results in case anybody needs info on the server we are using.
|
||||
client.info(function (err, reply) {
|
||||
var obj = {};
|
||||
reply.toString().split('\n').forEach(function (line) {
|
||||
var parts = line.split(':');
|
||||
if (parts[1]) {
|
||||
obj[parts[0]] = parts[1];
|
||||
}
|
||||
});
|
||||
obj.versions = [];
|
||||
obj.redis_version.split('.').forEach(function (num) {
|
||||
obj.versions.push(+num);
|
||||
});
|
||||
server_info = obj;
|
||||
});
|
||||
|
||||
connected = true;
|
||||
console.log();
|
||||
run_next_test();
|
||||
});
|
||||
|
||||
|
Reference in New Issue
Block a user