feat: change behaviour
Do not return event with ok status on first run of check. Will only return check result if anything went wrong.
This commit is contained in:
14
watchdog.go
14
watchdog.go
@@ -218,11 +218,8 @@ func (w *Watchdog) copyChecks() []Check {
|
||||
}
|
||||
|
||||
func (w *Watchdog) startMonitoring(wdc *wdCheck) {
|
||||
|
||||
wdc.stop = make(chan struct{})
|
||||
|
||||
state := CheckResult{}
|
||||
ticker := time.Tick(wdc.check.Interval)
|
||||
|
||||
c := wdc.check
|
||||
|
||||
// this method is called only with
|
||||
@@ -243,6 +240,15 @@ func (w *Watchdog) startMonitoring(wdc *wdCheck) {
|
||||
}
|
||||
}()
|
||||
|
||||
state := CheckResult{
|
||||
// if first run return anything
|
||||
// other that OK, we'll report it
|
||||
// if first run is OK, then we do not need to report
|
||||
Status: StatusOK,
|
||||
}
|
||||
|
||||
ticker := time.Tick(wdc.check.Interval)
|
||||
|
||||
for {
|
||||
w.limiter <- struct{}{}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user