delete pendings when recoverRule

This commit is contained in:
UlricQin 2022-01-12 13:50:29 +08:00
parent ac6f49e63d
commit f3924dab5b
1 changed files with 8 additions and 0 deletions

View File

@ -330,6 +330,14 @@ func (r RuleEval) fireEvent(event *models.AlertCurEvent) {
} }
func (r RuleEval) recoverRule(alertingKeys map[string]struct{}, now int64) { func (r RuleEval) recoverRule(alertingKeys map[string]struct{}, now int64) {
for hash := range r.pendings {
if _, has := alertingKeys[hash]; has {
continue
}
delete(r.pendings, hash)
}
for hash, event := range r.fires { for hash, event := range r.fires {
if _, has := alertingKeys[hash]; has { if _, has := alertingKeys[hash]; has {
continue continue