MCPcopy
hub / github.com/flyteorg/flyte / autoRefreshCache

Struct autoRefreshCache

flytestdlib/utils/auto_refresh_cache.go:94–100  ·  view source on GitHub ↗

Thread-safe general purpose auto-refresh cache that watches for updates asynchronously for the keys after they are added to the cache. An item can be inserted only once. Get reads from sync.map while refresh is invoked on a snapshot of keys. Cache eventually catches up on deleted items. Sync is ru

Source from the content-addressed store, hash-verified

92//
93// Sync is run as a fixed-interval-scheduled-task, and is skipped if sync from previous cycle is still running.
94type autoRefreshCache struct {
95 syncCb CacheSyncItem
96 lruMap *lru.Cache
97 syncRateLimiter RateLimiter
98 resyncPeriod time.Duration
99 scope promutils.Scope
100}
101
102func (w *autoRefreshCache) Start(ctx context.Context) {
103 go wait.Until(func() { w.sync(ctx) }, w.resyncPeriod, ctx.Done())

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected