129
saCache.expireOn = now.Add(cacheRefreshInterval)
130
err = nil
132
>
if saCache.dbVersion == 0 {
133
>
// If the cache is still cold, and persistence is Unavailable, retry more aggressively
134
>
// within cacheRefreshColdInterval.
135
>
saCache.expireOn = now.Add(time.Duration(rand.Int63n(int64(cacheRefreshColdInterval))))
136
>
} else {
137
>
// If persistence is Unavailable, but cache was loaded at least once, then ignore the error
138
>
// and use existing cache for cacheRefreshIfUnavailableInterval.
139
>
saCache.expireOn = now.Add(cacheRefreshIfUnavailableInterval)
140
>
err = nil
141
>
}
142
}
143
m.cache.Store(saCache)