Commit 54149771 by 宋毅

tj

parent 92abf713
File mode changed from 100755 to 100644
...@@ -43,14 +43,16 @@ class ConsumerBase { ...@@ -43,14 +43,16 @@ class ConsumerBase {
async execSubDoConsumer(queuedName, actionBody) { async execSubDoConsumer(queuedName, actionBody) {
var execResult = null; var execResult = null;
try { try {
const notifyQueuedName = "NOTIFY-SYTXPUBLIC-MSGQ";
this.subBeforeConsumer(queuedName, actionBody); this.subBeforeConsumer(queuedName, actionBody);
actionBody.requestId = await this.getBusUid("PUB-"); actionBody.requestId = await this.getBusUid("PUB-");
if (queuedName.indexOf("SYTXFAIL-SYTXPUBLIC-MSGQ") < 0) { if ("SYTXFAIL-SYTXPUBLIC-MSGQ" != queuedName) {
execResult = await this.subDoConsumer(queuedName, actionBody); execResult = await this.subDoConsumer(queuedName, actionBody);
actionBody.resultInfo = execResult; if (notifyQueuedName != queuedName) {
actionBody.resultInfo = execResult;
}
if (execResult.status === 1) { if (execResult.status === 1) {
var notifyQueuedName = "NOTIFY-SYTXPUBLIC-MSGQ"; if (notifyQueuedName != queuedName) {
if (queuedName.indexOf(notifyQueuedName) < 0) {
if (actionBody.notifyUrl && actionBody.notifyUrl.indexOf("http") >= 0) { if (actionBody.notifyUrl && actionBody.notifyUrl.indexOf("http") >= 0) {
await this.redisClient.lpushData(notifyQueuedName, actionBody); await this.redisClient.lpushData(notifyQueuedName, actionBody);
} }
...@@ -67,10 +69,14 @@ class ConsumerBase { ...@@ -67,10 +69,14 @@ class ConsumerBase {
return; return;
} }
if (actionBody.counter > 4) { if (actionBody.counter > 4) {
await this.pushFailureLogDao.addOpFailureLogs("推送失败", actionBody, actionBody.resultInfo); await this.pushFailureLogDao.addOpFailureLogs("推送失败", actionBody, actionBody.pushAgainResultInfo);
return; return;
} }
if (actionBody.pushAgainResultInfo) {
delete actionBody["pushAgainResultInfo"];
}
execResult = await this.subDoConsumer(queuedName, actionBody); execResult = await this.subDoConsumer(queuedName, actionBody);
actionBody.pushAgainResultInfo = execResult;
} catch (error) { } catch (error) {
var stackStr = error.stack ? error.stack : JSON.stringify(error); var stackStr = error.stack ? error.stack : JSON.stringify(error);
this.errorLogDao.addOpErrorLogs("队列执行execSubDoConsumer存在异常", actionBody, execResult, stackStr, 3); this.errorLogDao.addOpErrorLogs("队列执行execSubDoConsumer存在异常", actionBody, execResult, stackStr, 3);
......
File mode changed from 100755 to 100644
File mode changed from 100755 to 100644
File mode changed from 100755 to 100644
File mode changed from 100755 to 100644
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