fix: timer usage across codebase (#14935)

it seems in some places we have been wrongly using the
timer.Reset() function, nicely exposed by an example
shared by @donatello https://go.dev/play/p/qoF71_D1oXD

this PR fixes all the usage comprehensively
This commit is contained in:
Harshavardhana
2022-05-17 22:42:59 -07:00
committed by GitHub
parent 2dc8ac1e62
commit 6cfb1cb6fd
12 changed files with 36 additions and 40 deletions
+2 -2
View File
@@ -239,10 +239,10 @@ func lockMaintenance(ctx context.Context) {
case <-ctx.Done():
return
case <-lkTimer.C:
globalLockServer.expireOldLocks(lockValidityDuration)
// Reset the timer for next cycle.
lkTimer.Reset(lockMaintenanceInterval)
globalLockServer.expireOldLocks(lockValidityDuration)
}
}
}