Commit 50caa15f by 宋毅

tj

parent 6bc07855
...@@ -22,9 +22,9 @@ class ConsumerBase { ...@@ -22,9 +22,9 @@ class ConsumerBase {
} }
var self = this; var self = this;
this.duplicateInstance.brpop(queuedName, 3600, async function (err, repl) { this.duplicateInstance.brpop(queuedName, 3600, async function (err, repl) {
console.log(JSON.stringify(repl), "..............repl.............." + queuedName); console.log(JSON.stringify(repl), "..............repl.....info........." + queuedName);
if (err) { if (err) {
return new Error('doConsumer brpop error :' + err); return new Error("queuedName=" + queuedName + "doConsumer brpop error :" + err);
} }
else { else {
if (repl[1]) { if (repl[1]) {
...@@ -34,10 +34,10 @@ class ConsumerBase { ...@@ -34,10 +34,10 @@ class ConsumerBase {
} }
}); });
} catch (error) { } catch (error) {
//日志
var stackStr = error.stack ? error.stack : JSON.stringify(error); var stackStr = error.stack ? error.stack : JSON.stringify(error);
console.log(stackStr, ",队列执行doConsumer存在异常queuedName=" + queuedName);
this.errorLogDao.addOpErrorLogs("队列执行doConsumer存在异常", null, null, stackStr, 3); this.errorLogDao.addOpErrorLogs("队列执行doConsumer存在异常", null, null, stackStr, 3);
//日志
console.log(stackStr, ",队列执行doConsumer存在异常");
} }
} }
...@@ -87,10 +87,10 @@ class ConsumerBase { ...@@ -87,10 +87,10 @@ class ConsumerBase {
if (execResult && execResult.status == 1) { if (execResult && execResult.status == 1) {
await this.pushSuccessLogDao.addOpSuccessLogs("推送成功", actionBody, execResult); await this.pushSuccessLogDao.addOpSuccessLogs("推送成功", actionBody, execResult);
} else { } else {
//日志记录
var stackStr = error.stack ? error.stack : JSON.stringify(error); var stackStr = error.stack ? error.stack : JSON.stringify(error);
console.log(stackStr, ",队列执行execSubDoConsumer存在异常queuedName=" + queuedName);
this.errorLogDao.addOpErrorLogs("队列执行execSubDoConsumer存在异常", actionBody, execResult, stackStr, 3); this.errorLogDao.addOpErrorLogs("队列执行execSubDoConsumer存在异常", actionBody, execResult, stackStr, 3);
//日志记录
console.log(stackStr, ",队列执行execSubDoConsumer存在异常");
} }
} }
} }
...@@ -159,3 +159,5 @@ class ConsumerBase { ...@@ -159,3 +159,5 @@ class ConsumerBase {
} }
} }
module.exports = ConsumerBase; module.exports = ConsumerBase;
var stackStr = error.stack ? error.stack : JSON.stringify(error);
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment