possible fix

This commit is contained in:
uubulb 2024-12-26 22:55:25 +08:00
parent 747ef5656c
commit 003f1bbb2a

View File

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