liuxiulin 1 天之前
父节点
当前提交
842002f3cd
共有 1 个文件被更改,包括 5 次插入5 次删除
  1. 5 5
      pkg/ruleEngine/nodes/temp_alarm_node.go

+ 5 - 5
pkg/ruleEngine/nodes/temp_alarm_node.go

@@ -180,11 +180,11 @@ func (t *TempAlarmNode) evaluateConditions(message *protocol.Message) bool {
 		} else {
 		} else {
 			for _, r := range results {
 			for _, r := range results {
 				if r {
 				if r {
-					break
+					return true
 				}
 				}
-				_ = deleteAlarm(deviceId)
-				return false
 			}
 			}
+			_ = deleteAlarm(deviceId)
+			return false
 		}
 		}
 	}
 	}
 
 
@@ -215,9 +215,9 @@ func (t *TempAlarmNode) evaluateConditions(message *protocol.Message) bool {
 	}
 	}
 
 
 	duration := time.Now().Sub(time.Unix(reply.AlarmParams.FirstReportTime, 0))
 	duration := time.Now().Sub(time.Unix(reply.AlarmParams.FirstReportTime, 0))
-	if duration.Seconds() > float64(t.config.Interval*60) {
+	if duration.Seconds() > float64(t.config.Duration*60) {
 		interval := time.Now().Sub(time.Unix(reply.AlarmParams.LastAlarmTime, 0))
 		interval := time.Now().Sub(time.Unix(reply.AlarmParams.LastAlarmTime, 0))
-		if interval.Seconds() >= float64(t.config.Duration*60) {
+		if interval.Seconds() >= float64(t.config.Interval*60) {
 			setArgs := rpcs.ArgsAlarmInfo{
 			setArgs := rpcs.ArgsAlarmInfo{
 				DeviceCode:      deviceId,
 				DeviceCode:      deviceId,
 				FirstReportTime: reply.AlarmParams.FirstReportTime,
 				FirstReportTime: reply.AlarmParams.FirstReportTime,