feat(sj_1.0.0): 修复告警报错问题

This commit is contained in:
opensnail 2024-05-05 23:21:44 +08:00
parent 278d7a9658
commit 7015a8aa5b
2 changed files with 7 additions and 1 deletions

View File

@ -17,7 +17,9 @@ public enum JobNotifySceneEnum {
/********************************Workflow****************************************/
WORKFLOW_TASK_ERROR(100, "Workflow任务执行失败", NodeTypeEnum.SERVER),
WORKFLOW_TASK_CALLBACK_ERROR(101, "回调节点任务执行失败", NodeTypeEnum.SERVER)
WORKFLOW_TASK_CALLBACK_ERROR(101, "回调节点任务执行失败", NodeTypeEnum.SERVER),
WORKFLOW_TASK_DECISION_ERROR(102, "判定节点任务执行失败", NodeTypeEnum.SERVER),
;
/**

View File

@ -18,6 +18,7 @@ import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;
import java.util.List;
import java.util.Objects;
import java.util.concurrent.LinkedBlockingQueue;
import java.util.concurrent.TimeUnit;
@ -51,6 +52,9 @@ public class RetryTaskFailMoreThresholdAlarmListener extends
protected List<RetryAlarmInfo> poll() throws InterruptedException {
// 无数据时阻塞线程
RetryTask retryTask = queue.poll(100, TimeUnit.MILLISECONDS);
if (Objects.isNull(retryTask)) {
return Lists.newArrayList();
}
// 拉取100条
List<RetryTask> lists = Lists.newArrayList(retryTask);