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

Method areExpectedOutputsInCacheOnce

internal/devpkg/narinfo_cache.go:97–111  ·  view source on GitHub ↗

areExpectedOutputsInCacheOnce wraps fetchNarInfoStatusOnce and returns true if the expected outputs are in the cache.

(outputName string)

Source from the content-addressed store, hash-verified

95// areExpectedOutputsInCacheOnce wraps fetchNarInfoStatusOnce and returns true
96// if the expected outputs are in the cache.
97func (p *Package) areExpectedOutputsInCacheOnce(outputName string) (bool, error) {
98 outputToCache, err := p.fetchNarInfoStatusOnce(outputName)
99 if err != nil {
100 return false, err
101 }
102 if outputName == useDefaultOutputs {
103 outputs, err := p.outputsForOutputName(outputName)
104 // If we don't have default outputs, then we can't check if they are in the cache.
105 if err != nil || len(outputs) == 0 {
106 return false, err
107 }
108 return len(outputToCache) == len(outputs), nil
109 }
110 return len(outputToCache) == 1, nil
111}
112
113// fetchNarInfoStatusOnce fetches the cache status for the package and output.
114// It returns a map of outputs to cache URIs for each cache hit. Missing

Callers 2

IsOutputInBinaryCacheMethod · 0.95
IsInBinaryCacheMethod · 0.95

Calls 2

outputsForOutputNameMethod · 0.95

Tested by

no test coverage detected