MCPcopy Index your code
hub / github.com/jetify-com/devbox / readCaches

Function readCaches

internal/devpkg/narinfo_cache.go:322–336  ·  view source on GitHub ↗
(ctx context.Context)

Source from the content-addressed store, hash-verified

320var nixCacheIsConfigured = goutil.OnceValueWithContext(nixcache.IsConfigured)
321
322func readCaches(ctx context.Context) ([]string, error) {
323 cacheURIs := []string{binaryCache}
324 if !nixCacheIsConfigured.Do(ctx) {
325 return cacheURIs, nil
326 }
327
328 otherCaches, err := nixcache.CachedReadCaches(ctx)
329 if err != nil {
330 return nil, err
331 }
332 for _, c := range otherCaches {
333 cacheURIs = append(cacheURIs, c.GetUri())
334 }
335 return cacheURIs, nil
336}
337
338func ClearNarInfoCache() {
339 narInfoStatusFnCache = sync.Map{}

Callers 1

Calls 2

CachedReadCachesFunction · 0.92
DoMethod · 0.45

Tested by

no test coverage detected