client: fix race in heartbeat tracker (#14119)

This commit is contained in:
Michael Schurter
2022-08-16 09:41:08 -07:00
committed by GitHub
parent 4e3c3d472e
commit fc2ebe1c12

View File

@@ -70,7 +70,7 @@ func (h *heartbeatStop) shouldStopAfter(now time.Time, interval time.Duration) b
func (h *heartbeatStop) watch() {
// If we never manage to successfully contact the server, we want to stop our allocs
// after duration + start time
h.lastOk = time.Now()
h.setLastOk(time.Now())
stop := make(chan string, 1)
var now time.Time
var interval time.Duration