Skip to content

Commit

Permalink
feat: if we can't open the cache, fallback to no cache
Browse files Browse the repository at this point in the history
Signed-off-by: Brian McGee <[email protected]>
  • Loading branch information
brianmcgee committed Jul 3, 2024
1 parent 39bc446 commit f266fc8
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions cli/format.go
Original file line number Diff line number Diff line change
Expand Up @@ -120,8 +120,10 @@ func (f *Format) Run() (err error) {

// open the cache if configured
if !f.NoCache {
if cache.Open(f.TreeRoot, f.ClearCache, f.formatters); err != nil {
return err
if err = cache.Open(f.TreeRoot, f.ClearCache, f.formatters); err != nil {
// if we can't open the cache, we log a warning and fallback to no cache
log.Warnf("failed to open cache: %v", err)
f.NoCache = true
}
}

Expand Down

0 comments on commit f266fc8

Please sign in to comment.