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 package model
import ( import (
"slices"
"github.com/nezhahq/nezha/pkg/utils" "github.com/nezhahq/nezha/pkg/utils"
"gorm.io/gorm" "gorm.io/gorm"
) )
@ -83,13 +81,10 @@ func (r *AlertRule) Check(points [][]bool) (maxDuration int, passed bool) {
if maxDuration < 1 { if maxDuration < 1 {
maxDuration = 1 maxDuration = 1
} }
LOOP: for j := len(points) - 1; j >= 0; j-- {
for _, point := range points { if !points[j][i] {
for _, check := range slices.Backward(point) {
if !check {
failCount++ failCount++
break LOOP break
}
} }
} }
} else { } else {