mirror of
https://github.com/nezhahq/nezha.git
synced 2025-01-22 20:58: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)
|
ngf.Notifications = slices.Compact(ngf.Notifications)
|
||||||
|
|
||||||
var count int64
|
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)
|
return nil, newGormError("%v", err)
|
||||||
}
|
}
|
||||||
if count != int64(len(ngf.Notifications)) {
|
if count != int64(len(ngf.Notifications)) {
|
||||||
|
@ -85,8 +85,8 @@ func (r *AlertRule) Check(points [][]bool) (maxDuration int, passed bool) {
|
|||||||
if maxDuration < 1 {
|
if maxDuration < 1 {
|
||||||
maxDuration = 1
|
maxDuration = 1
|
||||||
}
|
}
|
||||||
for j := len(points[i]) - 1; j >= 0; j-- {
|
for j := len(points) - 1; j >= 0; j-- {
|
||||||
if !points[i][j] {
|
if !points[j][i] {
|
||||||
failCount++
|
failCount++
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user