diff --git a/server/home/home-service/src/main/java/io/holoinsight/server/home/biz/listener/AlarmRuleUpdateListener.java b/server/home/home-service/src/main/java/io/holoinsight/server/home/biz/listener/AlarmRuleUpdateListener.java index cddf0a32b..b7e6e6d4e 100644 --- a/server/home/home-service/src/main/java/io/holoinsight/server/home/biz/listener/AlarmRuleUpdateListener.java +++ b/server/home/home-service/src/main/java/io/holoinsight/server/home/biz/listener/AlarmRuleUpdateListener.java @@ -98,7 +98,11 @@ public void onEvent(AlarmRuleDTO alarmRuleDTO) { alarmMetricService.save(alarmMetric); } else { alarmMetric.setId(db.getId()); - alarmMetricService.updateById(alarmMetric); + if (alarmMetric.deleted) { + alarmMetricService.removeById(alarmMetric); + } else { + alarmMetricService.updateById(alarmMetric); + } } } }