Skip to content

Commit

Permalink
perf: job-manage错误日志优化 TencentBlueKing#2656
Browse files Browse the repository at this point in the history
重构部分代码
  • Loading branch information
jsonwan committed Dec 13, 2023
1 parent 8298c4b commit 3539aeb
Showing 1 changed file with 12 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -112,14 +112,18 @@ private boolean sendMsgWithRetry() {
);
result = true;
} catch (Exception e) {
long sleepMills = count * 1000;
String msg = MessageFormatter.format(
"Fail to sendMsg, sleep {}ms and retry {}",
sleepMills,
count
).getMessage();
log.error(msg, e);
ThreadUtils.sleep(sleepMills);
if (count < NOTIFY_MAX_RETRY_COUNT) {
long sleepMills = count * 1000;
String msg = MessageFormatter.format(
"Fail to sendMsg, sleep {}ms and retry {}",
sleepMills,
count
).getMessage();
log.warn(msg, e);
ThreadUtils.sleep(sleepMills);
} else {
log.error("Fail to sendMsg", e);
}
}
}
return result;
Expand Down

0 comments on commit 3539aeb

Please sign in to comment.