You've already forked node-redis
mirror of
https://github.com/redis/node-redis.git
synced 2025-08-07 13:22:56 +03:00
Improved reconnect logic. Initial version of reconnect thresholds.
This commit is contained in:
@@ -1,4 +1,6 @@
|
||||
var redis = require("redis").createClient();
|
||||
var redis = require("../index").createClient(null, null, {
|
||||
max_attempts: 2
|
||||
});
|
||||
|
||||
redis.on("error", function (err) {
|
||||
console.log("Redis says: " + err);
|
||||
@@ -11,6 +13,9 @@ redis.on("ready", function () {
|
||||
redis.on("reconnecting", function (arg) {
|
||||
console.log("Redis reconnecting: " + JSON.stringify(arg));
|
||||
});
|
||||
redis.on("not_reconnecting", function (arg) {
|
||||
console.log("Redis NOT reconnecting: " + arg);
|
||||
});
|
||||
redis.on("connect", function () {
|
||||
console.log("Redis connected.");
|
||||
});
|
||||
@@ -24,4 +29,4 @@ setInterval(function () {
|
||||
console.log(now + " Redis reply: " + res);
|
||||
}
|
||||
});
|
||||
}, 200);
|
||||
}, 100);
|
||||
|
Reference in New Issue
Block a user