bugfix: cannot delete alert_event when recovered
This commit is contained in:
parent
19c2fb6f82
commit
d809c6ffa9
2
build.sh
2
build.sh
|
@ -1,7 +1,7 @@
|
|||
#!/bin/bash
|
||||
|
||||
# release version
|
||||
version=5.0.0-rc7
|
||||
version=5.0.0-rc7-1
|
||||
|
||||
#export GO111MODULE=on
|
||||
#export GOPROXY=https://goproxy.cn
|
||||
|
|
|
@ -527,10 +527,14 @@ func sendEventIfNeed(status []bool, event *models.AlertEvent, stra *models.Alert
|
|||
func SendEvent(event *models.AlertEvent) {
|
||||
// update last event
|
||||
LastEvents.Set(event)
|
||||
ae, err := models.AlertEventGet("hash_id = ?", event.HashId)
|
||||
if err == nil && ae != nil {
|
||||
logger.Debugf("[event exists do not send again][type:%+v][event:%+v]", event.IsPromePull, event)
|
||||
return
|
||||
|
||||
if event.IsAlert() {
|
||||
// 只有是告警事件,才需要判断是否重复发送的问题,如果是恢复事件,就直接交给后续alert处理
|
||||
ae, err := models.AlertEventGet("hash_id = ?", event.HashId)
|
||||
if err == nil && ae != nil {
|
||||
logger.Debugf("[event exists do not send again][type:%+v][event:%+v]", event.IsPromePull, event)
|
||||
return
|
||||
}
|
||||
}
|
||||
|
||||
ok := EventQueue.PushFront(event)
|
||||
|
|
Loading…
Reference in New Issue