This commit is contained in:
SunYF
2026-10-26 16:32:35 +08:00
parent 4b14f9540a
commit f86feb2271
99 changed files with 1652 additions and 521 deletions
+8 -2
View File
@@ -231,9 +231,15 @@ func (s *Service) Evaluate(ctx context.Context, typ string, value float64, title
if err != nil || len(rules) == 0 {
return
}
dir := alertDirection(typ)
// 事件触发型(torque_ng / inspection_ng):enabled 即命中,忽略阈值比较(B2.3)。
// 阈值比较型(inventory_low / task_overdue 等)仍按方向 + 阈值判定。
eventType := typ == "torque_ng" || typ == "inspection_ng"
for _, r := range rules {
hit := (dir == 1 && value >= r.Threshold) || (dir == -1 && value <= r.Threshold)
hit := true
if !eventType {
dir := alertDirection(typ)
hit = (dir == 1 && value >= r.Threshold) || (dir == -1 && value <= r.Threshold)
}
if !hit {
continue
}