You've already forked node-redis
mirror of
https://github.com/redis/node-redis.git
synced 2025-08-07 13:22:56 +03:00
Remove deprecated max_delay
This commit is contained in:
committed by
Ruben Bridgewater
parent
b3106a45c4
commit
59725e3f20
@@ -204,11 +204,6 @@ describe('connection tests', function () {
|
||||
});
|
||||
|
||||
it('retryStrategy used to reconnect with individual error', function (done) {
|
||||
var text = '';
|
||||
var unhookIntercept = intercept(function (data) {
|
||||
text += data;
|
||||
return '';
|
||||
});
|
||||
client = redis.createClient({
|
||||
retryStrategy: function (options) {
|
||||
if (options.totalRetryTime > 150) {
|
||||
@@ -222,16 +217,8 @@ describe('connection tests', function () {
|
||||
}
|
||||
return Math.min(options.attempt * 25, 200);
|
||||
},
|
||||
retryMaxDelay: 123,
|
||||
port: 9999
|
||||
});
|
||||
process.nextTick(function () {
|
||||
assert.strictEqual(
|
||||
text,
|
||||
'node_redis: WARNING: You activated the retry_strategy and retry_max_delay at the same time. This is not possible and retry_max_delay will be ignored.\n'
|
||||
);
|
||||
unhookIntercept();
|
||||
});
|
||||
});
|
||||
|
||||
it('retry_strategy used to reconnect', function (done) {
|
||||
|
@@ -757,34 +757,6 @@ describe('The node_redis client', function () {
|
||||
// });
|
||||
});
|
||||
|
||||
describe('retry_max_delay', function () {
|
||||
it('sets upper bound on how long client waits before reconnecting', function (done) {
|
||||
var time;
|
||||
var timeout = process.platform !== 'win32' ? 20 : 100;
|
||||
|
||||
client = redis.createClient.apply(null, config.configureClient(parser, ip, {
|
||||
retry_max_delay: 1 // ms
|
||||
}));
|
||||
client.on('ready', function () {
|
||||
if (this.times_connected === 1) {
|
||||
this.stream.end();
|
||||
time = Date.now();
|
||||
} else {
|
||||
done();
|
||||
}
|
||||
});
|
||||
client.on('reconnecting', function () {
|
||||
time = Date.now() - time;
|
||||
assert(time < timeout, 'The reconnect should not have taken longer than ' + timeout + ' but it took ' + time);
|
||||
});
|
||||
client.on('error', function (err) {
|
||||
// This is rare but it might be triggered.
|
||||
// So let's have a robust test
|
||||
assert.strictEqual(err.code, 'ECONNRESET');
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
describe('protocol error', function () {
|
||||
|
||||
it('should gracefully recover and only fail on the already send commands', function (done) {
|
||||
|
Reference in New Issue
Block a user