1. delete recovery event from cache after event is really mark recovery (#758)

This commit is contained in:
ning1875 2021-08-04 12:14:47 +08:00 committed by GitHub
parent 8764270f47
commit 9383976918
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -46,7 +46,6 @@ func (s *SafeEventMap) DeleteOrSendRecovery(promql string, toKeepKeys map[string
}
if ev.ReadableExpression == promql {
logger.Debugf("[to_del][ev.IsRecovery:%+v][ev.LastSend:%+v][promql:%v]", ev.IsRecovery, ev.LastSend, promql)
delete(s.M, k)
now := time.Now().Unix()
// promql 没查询到结果,需要将告警标记为已恢复并发送
// 同时需要满足 已经发送过触发信息,并且时间差满足 大于AlertDuration
@ -55,6 +54,7 @@ func (s *SafeEventMap) DeleteOrSendRecovery(promql string, toKeepKeys map[string
logger.Debugf("[prom.alert.MarkRecov][promql:%v][ev.RuleName:%v]", promql, ev.RuleName)
ev.MarkRecov()
EventQueue.PushFront(ev)
delete(s.M, k)
}
}
}