Skip to content

Commit

Permalink
[filecache] Add IsCacheMiss (#283)
Browse files Browse the repository at this point in the history
  • Loading branch information
mikeland73 committed Apr 1, 2024
1 parent 09e8a66 commit 580a516
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions filecache/filecache.go
Original file line number Diff line number Diff line change
Expand Up @@ -90,3 +90,7 @@ func (c *cache) filename(key string) string {
_ = os.MkdirAll(dir, 0755)
return filepath.Join(dir, key)
}

func IsCacheMiss(err error) bool {
return errors.Is(err, NotFound) || errors.Is(err, Expired)
}

0 comments on commit 580a516

Please sign in to comment.