Sleep after the first round of monitoring
This commit is contained in:
parent
8953cdfa88
commit
d612e6c4b9
@ -21,8 +21,6 @@ func Monitor() {
|
|||||||
for _, service := range config.Get().Services {
|
for _, service := range config.Get().Services {
|
||||||
go func(service *core.Service) {
|
go func(service *core.Service) {
|
||||||
for {
|
for {
|
||||||
log.Printf("[watchdog][Monitor] Waiting interval=%s before monitoring serviceName=%s", service.Interval, service.Name)
|
|
||||||
time.Sleep(service.Interval)
|
|
||||||
log.Printf("[watchdog][Monitor] Monitoring serviceName=%s", service.Name)
|
log.Printf("[watchdog][Monitor] Monitoring serviceName=%s", service.Name)
|
||||||
result := service.EvaluateConditions()
|
result := service.EvaluateConditions()
|
||||||
rwLock.Lock()
|
rwLock.Lock()
|
||||||
@ -37,6 +35,8 @@ func Monitor() {
|
|||||||
len(result.Errors),
|
len(result.Errors),
|
||||||
result.Duration.Round(time.Millisecond),
|
result.Duration.Round(time.Millisecond),
|
||||||
)
|
)
|
||||||
|
log.Printf("[watchdog][Monitor] Waiting interval=%s before monitoring serviceName=%s", service.Interval, service.Name)
|
||||||
|
time.Sleep(service.Interval)
|
||||||
}
|
}
|
||||||
}(service)
|
}(service)
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user