From f492ac33bb56bda509246267b916263b3215fcfd Mon Sep 17 00:00:00 2001 From: Hao Miao <47212914+PushM@users.noreply.github.com> Date: Sun, 9 Jun 2024 04:18:07 +0800 Subject: [PATCH] =?UTF-8?q?1=E3=80=81=E5=8F=91=E9=80=81=E6=8C=87=E4=BB=A4?= =?UTF-8?q?=E6=96=B0=E5=BB=BA=E4=BF=A1=E5=8F=B7=E5=A2=9E=E5=8A=A0=E5=BC=82?= =?UTF-8?q?=E5=B8=B8=E5=A4=84=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../server/alertmessage/AlertMessageService.java | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/realtime/protection/server/alertmessage/AlertMessageService.java b/src/main/java/com/realtime/protection/server/alertmessage/AlertMessageService.java index 21c67ed..b735216 100644 --- a/src/main/java/com/realtime/protection/server/alertmessage/AlertMessageService.java +++ b/src/main/java/com/realtime/protection/server/alertmessage/AlertMessageService.java @@ -11,6 +11,7 @@ import com.realtime.protection.configuration.utils.enums.TaskTypeEnum; import com.realtime.protection.server.command.CommandService; import com.realtime.protection.server.task.status.StateHandler; import lombok.Data; +import lombok.extern.slf4j.Slf4j; import org.springframework.stereotype.Service; import java.time.LocalDateTime; @@ -21,6 +22,7 @@ import java.util.UUID; // AlertMessage的UUID在mapper插入数据库时生成了,这里提前生成好像美神恶魔用 @Service +@Slf4j public class AlertMessageService { private final CommandService commandService; private final AlertMessageMapper alertMessageMapper; @@ -144,7 +146,13 @@ public class AlertMessageService { alertMessageMapper.insertAlertMessage(alertMessage); } //发送指令新建信号 - stateHandler.sendCommandDistributeSignal(commandUUIDs); + try { + stateHandler.sendCommandDistributeSignal(commandUUIDs); + }catch (Exception e) { + log.info(String.format("动态任务首次指令下发c3出错,任务id: %d,commandUUIDs: %s", + dynamicTaskCommandInfoList.get(0).getTaskId(), + commandUUIDs)); + } } private String insertAlertMessageOnly(AlertMessage alertMessage){