Revert "possible fix"

This reverts commit 003f1bbb2a.
This commit is contained in:
uubulb 2024-12-26 23:34:15 +08:00
parent 36d00f58a2
commit b07bfdf63d

View File

@ -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 {
failCount++
break LOOP
}
for j := len(points) - 1; j >= 0; j-- {
if !points[j][i] {
failCount++
break
}
}
} else {