mirror of
https://github.com/Buriburizaem0n/nezha_domains.git
synced 2026-02-04 04:30:05 +00:00
fix: ignore the duration of out-of-bound rules (#1019)
This commit is contained in:
@@ -109,12 +109,12 @@ func (r *AlertRule) Check(points [][]bool) (int, bool) {
|
||||
continue
|
||||
} else {
|
||||
// 常规报警
|
||||
if duration > durations[ruleIndex] {
|
||||
durations[ruleIndex] = duration
|
||||
}
|
||||
if hasPassedRule = boundCheck(len(points), duration, hasPassedRule); hasPassedRule {
|
||||
continue
|
||||
}
|
||||
if duration > durations[ruleIndex] {
|
||||
durations[ruleIndex] = duration
|
||||
}
|
||||
total, fail := duration, 0
|
||||
for timeTick := len(points) - duration; timeTick < len(points); timeTick++ {
|
||||
if !points[timeTick][ruleIndex] {
|
||||
|
||||
Reference in New Issue
Block a user