提交
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user