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 7728cf5a9a
commit db97e08163
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

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