Skip to content

Commit

Permalink
Merge 704df4b into 46e352a
Browse files Browse the repository at this point in the history
  • Loading branch information
dellalu committed Oct 23, 2019
2 parents 46e352a + 704df4b commit bd64bca
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions core/internal/notifier/coordinator.go
Expand Up @@ -553,6 +553,11 @@ func (nc *Coordinator) notifyModule(module Module, status *protocol.ConsumerGrou
return
}

// Only send the open notification once if send-once is configured
if (!cgroup.LastNotify[module.GetName()].IsZero()) && viper.GetBool("notifier."+moduleName+".send-once") {
return
}

// Only send the notification if it's been at least our Interval since the last one for this group
currentTime := time.Now()
if currentTime.Sub(cgroup.LastNotify[module.GetName()]) > (time.Duration(viper.GetInt("notifier."+moduleName+".send-interval")) * time.Second) {
Expand Down

0 comments on commit bd64bca

Please sign in to comment.