areExpectedOutputsInCacheOnce wraps fetchNarInfoStatusOnce and returns true if the expected outputs are in the cache.
(outputName string)
| 95 | // areExpectedOutputsInCacheOnce wraps fetchNarInfoStatusOnce and returns true |
| 96 | // if the expected outputs are in the cache. |
| 97 | func (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 |
no test coverage detected