This commit is contained in:
uubulb 2024-12-26 17:49:26 +08:00
parent 1824fb86cd
commit 41d68e5051

View File

@ -64,6 +64,9 @@ func (r *AlertRule) Enabled() bool {
// Snapshot 对传入的Server进行该报警规则下所有type的检查 返回每项检查结果 // Snapshot 对传入的Server进行该报警规则下所有type的检查 返回每项检查结果
func (r *AlertRule) Snapshot(cycleTransferStats *CycleTransferStats, server *Server, db *gorm.DB, role uint8) []bool { func (r *AlertRule) Snapshot(cycleTransferStats *CycleTransferStats, server *Server, db *gorm.DB, role uint8) []bool {
point := make([]bool, len(r.Rules)) point := make([]bool, len(r.Rules))
for i := range point {
point[i] = true
}
if r.UserID != server.UserID && role != RoleAdmin { if r.UserID != server.UserID && role != RoleAdmin {
return point return point