mirror of
https://github.com/nezhahq/nezha.git
synced 2025-01-22 12:48:14 -05:00
bug fixes
This commit is contained in:
parent
87e01a532e
commit
915a20007e
@ -168,7 +168,7 @@ func updateNotificationGroup(c *gin.Context) (any, error) {
|
||||
ngf.Notifications = slices.Compact(ngf.Notifications)
|
||||
|
||||
var count int64
|
||||
if err := singleton.DB.Model(&model.Server{}).Where("id in (?)", ngf.Notifications).Count(&count).Error; err != nil {
|
||||
if err := singleton.DB.Model(&model.Notification{}).Where("id in (?)", ngf.Notifications).Count(&count).Error; err != nil {
|
||||
return nil, newGormError("%v", err)
|
||||
}
|
||||
if count != int64(len(ngf.Notifications)) {
|
||||
|
@ -85,8 +85,8 @@ func (r *AlertRule) Check(points [][]bool) (maxDuration int, passed bool) {
|
||||
if maxDuration < 1 {
|
||||
maxDuration = 1
|
||||
}
|
||||
for j := len(points[i]) - 1; j >= 0; j-- {
|
||||
if !points[i][j] {
|
||||
for j := len(points) - 1; j >= 0; j-- {
|
||||
if !points[j][i] {
|
||||
failCount++
|
||||
break
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user