1
0
mirror of https://github.com/redis/node-redis.git synced 2025-08-07 13:22:56 +03:00

Merge branch 'add-retry-max' of https://github.com/tomaszdurka/node_redis into tomaszdurka-add-retry-max

This commit is contained in:
Bryce Baril
2013-03-17 15:59:40 -07:00
3 changed files with 34 additions and 2 deletions

22
test.js
View File

@@ -1846,6 +1846,28 @@ tests.auth = function () {
});
};
tests.reconnectRetryMaxDelay = function() {
var time = new Date().getTime(),
name = 'reconnectRetryMaxDelay',
reconnecting = false;
var client = redis.createClient(PORT, HOST, {
retry_max_delay: 1
});
client.on('ready', function() {
if (!reconnecting) {
reconnecting = true;
client.retry_delay = 1000;
client.retry_backoff = 1;
client.stream.end();
} else {
client.end();
var lasted = new Date().getTime() - time;
assert.ok(lasted < 1000);
next(name);
}
});
};
all_tests = Object.keys(tests);
all_start = new Date();
test_count = 0;