From f2a6a20a74ec2d090ca4d7d9362add6765c487cd Mon Sep 17 00:00:00 2001 From: Matt Ranney Date: Sun, 13 Nov 2011 18:10:22 -1000 Subject: [PATCH] Send quit command right away. The quit/pipeline bug has been fixed in Redis server for some time now. --- examples/simple.js | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/examples/simple.js b/examples/simple.js index b93c557d2b..f1f2e3209b 100644 --- a/examples/simple.js +++ b/examples/simple.js @@ -2,16 +2,23 @@ var redis = require("redis"), client = redis.createClient(); client.on("error", function (err) { - console.log("Redis connection error to " + client.host + ":" + client.port + " - " + err); + console.log("error event - " + client.host + ":" + client.port + " - " + err); }); client.set("string key", "string val", redis.print); client.hset("hash key", "hashtest 1", "some value", redis.print); client.hset(["hash key", "hashtest 2", "some other value"], redis.print); client.hkeys("hash key", function (err, replies) { + if (err) { + return console.error("error response - " + err); + } + console.log(replies.length + " replies:"); replies.forEach(function (reply, i) { console.log(" " + i + ": " + reply); }); - client.quit(); +}); + +client.quit(function (err, res) { + console.log("Exiting from quit command."); });