Skip to content

Commit 580a516

Browse files
authored
[filecache] Add IsCacheMiss (#283)
## Summary In response to: https://github.com/jetpack-io/devbox/blob/main/internal/nix/search.go#L175-L175 ## How was it tested?
1 parent 09e8a66 commit 580a516

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

filecache/filecache.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,3 +90,7 @@ func (c *cache) filename(key string) string {
9090
_ = os.MkdirAll(dir, 0755)
9191
return filepath.Join(dir, key)
9292
}
93+
94+
func IsCacheMiss(err error) bool {
95+
return errors.Is(err, NotFound) || errors.Is(err, Expired)
96+
}

0 commit comments

Comments
 (0)