From 4da56523f31a694aa885920e7874e8bc633548e9 Mon Sep 17 00:00:00 2001 From: Tufan Baris Yildirim Date: Fri, 6 Sep 2019 00:48:27 +0300 Subject: [PATCH] bypass notifier limits if the state is changing first time with that event. --- core/notifier/events.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/notifier/events.go b/core/notifier/events.go index 3f0fdd1c..05a52287 100644 --- a/core/notifier/events.go +++ b/core/notifier/events.go @@ -35,7 +35,7 @@ func OnFailure(s *types.Service, f *types.Failure) { return } for _, comm := range AllCommunications { - if isType(comm, new(BasicEvents)) && isEnabled(comm) && inLimits(comm) { + if isType(comm, new(BasicEvents)) && isEnabled(comm) && (s.Online || inLimits(comm)) { comm.(BasicEvents).OnFailure(s, f) } } @@ -48,7 +48,7 @@ func OnSuccess(s *types.Service) { return } for _, comm := range AllCommunications { - if isType(comm, new(BasicEvents)) && isEnabled(comm) && inLimits(comm) { + if isType(comm, new(BasicEvents)) && isEnabled(comm) && (!s.Online || inLimits(comm)) { comm.(BasicEvents).OnSuccess(s) } }