Bug:Fix file validation issue
[vnfsdk/refrepo.git] / vnfmarket / src / main / webapp / vnfmarket / node_modules / redis / benches / reconnect_test.js
1 var redis = require("../index").createClient(null, null, {
2 //    max_attempts: 4
3 });
4
5 redis.on("error", function (err) {
6     console.log("Redis says: " + err);
7 });
8
9 redis.on("ready", function () {
10     console.log("Redis ready.");
11 });
12
13 redis.on("reconnecting", function (arg) {
14     console.log("Redis reconnecting: " + JSON.stringify(arg));
15 });
16 redis.on("connect", function () {
17     console.log("Redis connected.");
18 });
19
20 setInterval(function () {
21     var now = Date.now();
22     redis.set("now", now, function (err, res) {
23         if (err) {
24             console.log(now + " Redis reply error: " + err);
25         } else {
26             console.log(now + " Redis reply: " + res);
27         }
28     });
29 }, 100);