...
|
...
|
@@ -48,18 +48,19 @@ module.exports = { |
|
|
|
|
|
// host: '192.168.102.49',
|
|
|
port: '6379',
|
|
|
enable_offline_queue: false,
|
|
|
retry_strategy(options) {
|
|
|
if (options.error && options.error.code === 'ECONNREFUSED') {
|
|
|
console.log('redis连接不成功');
|
|
|
console.log('connect redis server fail');
|
|
|
}
|
|
|
if (options.total_retry_time > 1000 * 60 * 60 * 6) {
|
|
|
console.log('redis连接超时');
|
|
|
return;
|
|
|
}
|
|
|
if (options.attempt > 10) {
|
|
|
return 1000 * 60 * 60 * 0.5;
|
|
|
|
|
|
if (options.attempt < 10) {
|
|
|
return Math.min(options.attempt * 100, 1000);
|
|
|
} else if (options.attempt > 10 && options.attempt < 100) {
|
|
|
return 1000;
|
|
|
} else {
|
|
|
return 1000 * 10;
|
|
|
}
|
|
|
return Math.min(options.attempt * 100, 1000);
|
|
|
}
|
|
|
},
|
|
|
session: {
|
...
|
...
|
@@ -120,18 +121,19 @@ if (isProduction) { |
|
|
connect: {
|
|
|
host: 'web.redis.yohoops.org',
|
|
|
port: '6379',
|
|
|
enable_offline_queue: false,
|
|
|
retry_strategy(options) {
|
|
|
if (options.error && options.error.code === 'ECONNREFUSED') {
|
|
|
console.log('redis连接不成功');
|
|
|
console.log('connect redis server fail');
|
|
|
}
|
|
|
if (options.total_retry_time > 1000 * 60 * 60 * 6) {
|
|
|
console.log('redis连接超时');
|
|
|
return;
|
|
|
}
|
|
|
if (options.attempt > 10) {
|
|
|
return 1000 * 60 * 60 * 0.5;
|
|
|
|
|
|
if (options.attempt < 10) {
|
|
|
return Math.min(options.attempt * 100, 1000);
|
|
|
} else if (options.attempt > 10 && options.attempt < 100) {
|
|
|
return 1000;
|
|
|
} else {
|
|
|
return 1000 * 10;
|
|
|
}
|
|
|
return Math.min(options.attempt * 100, 1000);
|
|
|
}
|
|
|
},
|
|
|
session: {
|
...
|
...
|
|