There was an error while loading. Please reload this page.
1 parent 5c8aafc commit 1408ec4Copy full SHA for 1408ec4
1 file changed
token/services/selector/simple/inmemory/locker.go
@@ -381,6 +381,9 @@ func (d *locker) lockedCount() int {
381
382
func (d *locker) scan(ctx context.Context) {
383
defer close(d.scanDone)
384
+
385
+ ticker := time.NewTicker(d.sleepTimeout)
386
+ defer ticker.Stop()
387
for {
388
// Check for shutdown before starting a new scan cycle.
389
select {
@@ -462,7 +465,7 @@ func (d *locker) scan(ctx context.Context) {
462
465
463
466
logger.DebugfContext(ctx, "token collector: sleep for some time...")
464
467
- case <-time.After(d.sleepTimeout):
468
+ case <-ticker.C:
469
case <-ctx.Done():
470
logger.Debugf("token collector: stopping during sleep")
471
0 commit comments