Skip to content
Snippets Groups Projects
Commit b845b6d9 authored by Richard T. Carback III's avatar Richard T. Carback III
Browse files

Revert back to original timer logic (but keep the changes to use timer per the docs)

parent 6df18a88
No related branches found
No related tags found
No related merge requests found
......@@ -123,21 +123,21 @@ func (t *Tracker) start(quitCh <-chan struct{}) {
break
case heartbeat = <-t.heartbeat:
jww.INFO.Printf("heartbeat: %v", heartbeat)
if healthy(heartbeat) {
// Stop and reset timer
if !timer.Stop() {
select {
case <-timer.C: // per docs explicitly drain
// per docs explicitly drain
case <-timer.C:
default:
}
}
timer.Reset(t.timeout)
if healthy(heartbeat) {
t.setHealth(true)
}
break
case <-timer.C:
t.setHealth(false)
timer.Reset(t.timeout)
break
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment