Merge pull request #1322 from hugomiguelabreu/master
Defined retry_strategy for redis. Closes #1292
This commit is contained in:
commit
8f17c86611
@ -10,7 +10,14 @@ module.exports = function(config) {
|
||||
const redis = require(redis_lib);
|
||||
const client = redis.createClient({
|
||||
host: config.redis_host,
|
||||
connect_timeout: 10000
|
||||
retry_strategy: options => {
|
||||
if (options.total_retry_time > 10000) {
|
||||
client.emit('error', 'Retry time exhausted');
|
||||
return new Error('Retry time exhausted');
|
||||
}
|
||||
|
||||
return 500;
|
||||
}
|
||||
});
|
||||
|
||||
client.ttlAsync = promisify(client.ttl);
|
||||
|
Loading…
Reference in New Issue
Block a user