diff --git a/network/health/tracker.go b/network/health/tracker.go index 7d5b6a7d9c36edd2723685276c385c114b20bc13..69fdb0b13e01cdb032138ba2ef51f8d90448bb09 100644 --- a/network/health/tracker.go +++ b/network/health/tracker.go @@ -162,8 +162,6 @@ func (t *Tracker) Start() (stoppable.Stoppable, error) { // start starts a long-running thread used to monitor and report on network // health. func (t *Tracker) start(stop *stoppable.Single) { - timer := time.NewTimer(t.timeout) - for { var heartbeat network.Heartbeat select { @@ -179,18 +177,9 @@ func (t *Tracker) start(stop *stoppable.Single) { return case heartbeat = <-t.heartbeat: if healthy(heartbeat) { - // Stop and reset timer - if !timer.Stop() { - select { - // per docs explicitly drain - case <-timer.C: - default: - } - } - timer.Reset(t.timeout) t.setHealth(true) } - case <-timer.C: + case <-time.After(t.timeout): if !t.isHealthy { jww.WARN.Printf("Network health tracker timed out, network is no longer healthy...") }