...
|
...
|
@@ -3,6 +3,8 @@ const _ = require('lodash'); |
|
|
const redis = require('redis');
|
|
|
const bluebird = require('bluebird');
|
|
|
const config = require('../../config/common');
|
|
|
const logger = global.yoho.logger;
|
|
|
const timeout = 200; // redis 操作超时时间
|
|
|
let client;
|
|
|
|
|
|
try {
|
...
|
...
|
@@ -20,9 +22,14 @@ try { |
|
|
}
|
|
|
}
|
|
|
|
|
|
return client.multi.call(client, args).execAsync();
|
|
|
return client.multi.call(client, args).execAsync().timeout(timeout).catch(()=>{
|
|
|
logger.err('redis exe time out');
|
|
|
return false;
|
|
|
});
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
client.on('error', function() {
|
|
|
global.yoho.redis = '';
|
|
|
});
|
...
|
...
|
|