You've already forked node-redis
mirror of
https://github.com/redis/node-redis.git
synced 2025-08-07 13:22:56 +03:00
* connection error did not properly trigger reconnection logic [GH-85] * client.hmget(key, [val1, val2]) was not expanding properly [GH-66] * client.quit() while in pub/sub mode would throw an error [GH-87] * client.multi(['hmset', 'key', {foo: 'bar'}]) fails [GH-92]
28 lines
659 B
JavaScript
28 lines
659 B
JavaScript
var redis = require("redis").createClient();
|
|
|
|
redis.on("error", function (err) {
|
|
console.log("Redis says: " + err);
|
|
});
|
|
|
|
redis.on("ready", function () {
|
|
console.log("Redis ready.");
|
|
});
|
|
|
|
redis.on("reconnecting", function (arg) {
|
|
console.log("Redis reconnecting: " + JSON.stringify(arg));
|
|
});
|
|
redis.on("connect", function () {
|
|
console.log("Redis connected.");
|
|
});
|
|
|
|
setInterval(function () {
|
|
var now = Date.now();
|
|
redis.set("now", now, function (err, res) {
|
|
if (err) {
|
|
console.log(now + " Redis reply error: " + err);
|
|
} else {
|
|
console.log(now + " Redis reply: " + res);
|
|
}
|
|
});
|
|
}, 200);
|