func()

in secretcache/cacheItem.go [131:145]


func (ci *secretCacheItem) refreshNow(ctx context.Context) {
	ci.refreshNeeded = true
	// Generate a random number to have a sleep jitter to not get stuck in a retry loop
	sleep := rand.Int63n((forceRefreshJitterSleep+1)-(forceRefreshJitterSleep/2)+1) + (forceRefreshJitterSleep / 2)

	if ci.err != nil {
		exceptionSleep := ci.nextRefreshTime - time.Now().UnixNano()
		if exceptionSleep > sleep {
			sleep = exceptionSleep
		}
	}

	time.Sleep(time.Millisecond * time.Duration(sleep))
	ci.refresh(ctx)
}