Notifications afterCount reorder

pull/1081/head
Guillaume LAN CHOW WING 2021-11-26 12:01:51 +01:00
parent a8a2ef85b7
commit 6a8026067f
1 changed files with 5 additions and 5 deletions

View File

@ -23,9 +23,12 @@ func sendSuccess(s *Service) {
return return
} }
s.notifyAfterCount = 0
if s.prevOnline == s.Online { if s.prevOnline == s.Online {
return return
} }
s.prevOnline = true
for _, n := range allNotifiers { for _, n := range allNotifiers {
notif := n.Select() notif := n.Select()
@ -42,9 +45,6 @@ func sendSuccess(s *Service) {
notif.LastSent = utils.Now() notif.LastSent = utils.Now()
} }
} }
s.prevOnline = true
s.notifyAfterCount = 0
} }
func sendFailure(s *Service, f *failures.Failure) { func sendFailure(s *Service, f *failures.Failure) {
@ -63,6 +63,8 @@ func sendFailure(s *Service, f *failures.Failure) {
} }
} }
s.prevOnline = false
for _, n := range allNotifiers { for _, n := range allNotifiers {
notif := n.Select() notif := n.Select()
if notif.CanSend() { if notif.CanSend() {
@ -78,8 +80,6 @@ func sendFailure(s *Service, f *failures.Failure) {
notif.LastSent = utils.Now() notif.LastSent = utils.Now()
} }
} }
s.prevOnline = false
} }
func logMessage(method string, msg string, error error, onSuccesss bool, serviceId int64) { func logMessage(method string, msg string, error error, onSuccesss bool, serviceId int64) {