Add implementation of new `Service` Fields in checker.go

Add Variable Value changes of `SuccessNOtified`, `UpdateNotify` and
`DownText` to checker.go.
So the Values can be used in other packages.
pull/258/head
Emanuel Bennici 2019-10-04 17:23:20 +02:00
parent d81c525d71
commit e1c41966e4
No known key found for this signature in database
GPG Key ID: 17FA2D56BAD01661
1 changed files with 4 additions and 0 deletions

View File

@ -263,6 +263,7 @@ func recordSuccess(s *Service) {
s.CreateHit(hit)
s.Online = true
notifier.OnSuccess(s.Service)
s.SuccessNotified = true
}
// recordFailure will create a new 'Failure' record in the database for a offline service
@ -277,5 +278,8 @@ func recordFailure(s *Service, issue string) {
utils.Log(2, fmt.Sprintf("Service %v Failing: %v | Lookup in: %0.2f ms", s.Name, issue, fail.PingTime*1000))
s.CreateFailure(fail)
s.Online = false
s.SuccessNotified = false
s.UpdateNotify = CoreApp.UpdateNotify.Bool
s.DownText = s.DowntimeText()
notifier.OnFailure(s.Service, fail.Failure)
}