Skip to content

Commit f266fc8

Browse files
committed
feat: if we can't open the cache, fallback to no cache
Signed-off-by: Brian McGee <[email protected]>
1 parent 39bc446 commit f266fc8

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

Diff for: cli/format.go

+4-2
Original file line numberDiff line numberDiff line change
@@ -120,8 +120,10 @@ func (f *Format) Run() (err error) {
120120

121121
// open the cache if configured
122122
if !f.NoCache {
123-
if cache.Open(f.TreeRoot, f.ClearCache, f.formatters); err != nil {
124-
return err
123+
if err = cache.Open(f.TreeRoot, f.ClearCache, f.formatters); err != nil {
124+
// if we can't open the cache, we log a warning and fallback to no cache
125+
log.Warnf("failed to open cache: %v", err)
126+
f.NoCache = true
125127
}
126128
}
127129

0 commit comments

Comments
 (0)