mirror of
https://github.com/optim-enterprises-bv/vault.git
synced 2025-10-30 10:12:35 +00:00
VAULT-8436 remove <-time.After statements in for loops (#18818)
* replace time.After with ticker in loops * add semgrep rule * update to use timers * remove stop
This commit is contained in:
@@ -366,10 +366,12 @@ func (r *LifetimeWatcher) doRenewWithOptions(tokenMode bool, nonRenewable bool,
|
||||
return nil
|
||||
}
|
||||
|
||||
timer := time.NewTimer(sleepDuration)
|
||||
select {
|
||||
case <-r.stopCh:
|
||||
timer.Stop()
|
||||
return nil
|
||||
case <-time.After(sleepDuration):
|
||||
case <-timer.C:
|
||||
continue
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user