Browse Source

[FIX] 告警事件转存判断bug

pujielan 1 month ago
parent
commit
73b32cf986
1 changed files with 3 additions and 2 deletions
  1. 3 2
      handler/events.go

+ 3 - 2
handler/events.go

@@ -330,7 +330,8 @@ func (e *EventHandler) CreateEventRecord(chdb *gorm.DB) *EventHandler {
 			e.Errs["CreateEventRecord_func(Create)"] = err
 			logger.Error("create emos err:", err.Error())
 		}
-		if e.JR.AlertStatus == FIRING {
+		//发生告警,生成告警数据
+		if e.JR.AlertStatus >= FIRING {
 			e.Emo = &emo
 		}
 	}
@@ -338,7 +339,7 @@ func (e *EventHandler) CreateEventRecord(chdb *gorm.DB) *EventHandler {
 }
 
 func (e *EventHandler) CreateAlert(db *gorm.DB) *EventHandler {
-	if e.JR.AlertStatus == FIRING || e.JR.AlertStatus == SENDSUCCESS {
+	if e.JR.AlertStatus >= FIRING {
 		//TODO:  发送至告警队列
 		fe := amodels.OtFireEvents{
 			AppId:         e.Emo.AppID,