func()

in secretcache/cacheItem.go [148:170]


func (ci *secretCacheItem) refresh(ctx context.Context) {
	if !ci.isRefreshNeeded() {
		return
	}

	ci.refreshNeeded = false

	result, err := ci.executeRefresh(ctx)

	if err != nil {
		ci.errorCount++
		ci.err = err
		delay := exceptionRetryDelayBase * math.Pow(exceptionRetryGrowthFactor, float64(ci.errorCount))
		delay = math.Min(delay, exceptionRetryDelayMax)
		delayDuration := time.Millisecond * time.Duration(delay)
		ci.nextRetryTime = time.Now().Add(delayDuration).UnixNano()
		return
	}

	ci.setWithHook(result)
	ci.err = nil
	ci.errorCount = 0
}