mirror of
https://github.com/nezhahq/nezha.git
synced 2025-01-22 20:58:14 -05:00
parent
36d00f58a2
commit
b07bfdf63d
@ -1,8 +1,6 @@
|
||||
package model
|
||||
|
||||
import (
|
||||
"slices"
|
||||
|
||||
"github.com/nezhahq/nezha/pkg/utils"
|
||||
"gorm.io/gorm"
|
||||
)
|
||||
@ -83,13 +81,10 @@ func (r *AlertRule) Check(points [][]bool) (maxDuration int, passed bool) {
|
||||
if maxDuration < 1 {
|
||||
maxDuration = 1
|
||||
}
|
||||
LOOP:
|
||||
for _, point := range points {
|
||||
for _, check := range slices.Backward(point) {
|
||||
if !check {
|
||||
for j := len(points) - 1; j >= 0; j-- {
|
||||
if !points[j][i] {
|
||||
failCount++
|
||||
break LOOP
|
||||
}
|
||||
break
|
||||
}
|
||||
}
|
||||
} else {
|
||||
|
Loading…
Reference in New Issue
Block a user