Skip to content

Commit

Permalink
update cachekey
Browse files Browse the repository at this point in the history
  • Loading branch information
pyama86 committed Feb 19, 2019
1 parent 5997313 commit d9b0ade
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions wazuh_notifier/slack.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,12 +62,10 @@ func (s *Slack) Notify(a *Alert) error {
return err
}
for _, g := range groups {
ruleID, found := s.cache.Get(g)
_, found := s.cache.Get(g + a.Rule.ID)
if found {
if ruleID == a.Rule.ID {
fmt.Printf("skip notify group %s, ruleid %s\n", g, a.Rule.ID)
continue
}
fmt.Printf("skip notify group %s, ruleid %s\n", g, a.Rule.ID)
continue
}

gd, ok := s.c.Groups[g]
Expand Down Expand Up @@ -105,7 +103,7 @@ func (s *Slack) Notify(a *Alert) error {
if err != nil {
return err
}
s.cache.Set(g, a.Rule.ID, cache.DefaultExpiration)
s.cache.Set(g+a.Rule.ID, a.Rule.ID, cache.DefaultExpiration)
}
s.cache.SaveFile(s.c.IgnoreHistoryFile)
return nil
Expand Down

0 comments on commit d9b0ade

Please sign in to comment.