...
|
...
|
@@ -149,24 +149,27 @@ module.exports = { |
|
|
redis: {
|
|
|
connect: {
|
|
|
host: '127.0.0.1',
|
|
|
|
|
|
// host: '192.168.102.49',
|
|
|
port: '6379',
|
|
|
enable_offline_queue: false,
|
|
|
retry_strategy(options) {
|
|
|
if (options.error && options.error.code === 'ECONNREFUSED') {
|
|
|
console.log('redis连接不成功');
|
|
|
}
|
|
|
if (options.total_retry_time > 1000 * 60 * 60 * 6) {
|
|
|
console.log('redis连接超时');
|
|
|
return;
|
|
|
}
|
|
|
if (options.attempt > 10) {
|
|
|
return 1000 * 60 * 60 * 0.5;
|
|
|
console.log('connect redis server fail');
|
|
|
}
|
|
|
|
|
|
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;
|
|
|
}
|
|
|
}
|
|
|
},
|
|
|
session: {
|
|
|
host: '127.0.0.1',
|
|
|
|
|
|
// host: '192.168.102.49',
|
|
|
port: '6379',
|
|
|
prefix: 'yohobuy_session:'
|
...
|
...
|
@@ -214,18 +217,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连接不成功');
|
|
|
}
|
|
|
if (options.total_retry_time > 1000 * 60 * 60 * 6) {
|
|
|
console.log('redis连接超时');
|
|
|
return;
|
|
|
}
|
|
|
if (options.attempt > 10) {
|
|
|
return 1000 * 60 * 60 * 0.5;
|
|
|
console.log('connect redis server fail');
|
|
|
}
|
|
|
|
|
|
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;
|
|
|
}
|
|
|
}
|
|
|
},
|
|
|
session: {
|
...
|
...
|
|