|
@ -20,16 +20,18 @@ let redisPubClient = null;
|
|
|
class RedisPubClient {
|
|
|
constructor() {
|
|
|
var redisConfig = config.innerRedisConfig;
|
|
|
redisConfig.retry_strategy = function(options){
|
|
|
log.info("pub Redis重新连接次数:"+options.times_connected);
|
|
|
redisConfig.retry_strategy = function(options){
|
|
|
log.info("pub Redis重新连接次数:"+options.times_connected);
|
|
|
if (options.error!=null){
|
|
|
if (options.error.code === 'ECONNREFUSED') {
|
|
|
log.error('pub Redis连接被拒绝');
|
|
|
}
|
|
|
if (options.times_connected > 10) {
|
|
|
log.error('pub Redis重试连接超过十次');
|
|
|
}
|
|
|
return Math.max(options.attempt * 100, 3000);
|
|
|
}
|
|
|
if (options.times_connected > 10) {
|
|
|
log.error('pub Redis重试连接超过十次');
|
|
|
}
|
|
|
return Math.max(options.attempt * 100, 3000);
|
|
|
}
|
|
|
this._connection = redis.createClient(
|
|
|
config.innerRedisConfig
|
|
|
);
|