mirror of
https://github.com/numtide/treefmt.git
synced 2024-10-05 13:07:17 +03:00
Merge pull request #330 from numtide/feat/cache-fallback
feat: if we can't open the cache, fallback to no cache
This commit is contained in:
commit
45cc82c105
@ -120,8 +120,10 @@ func (f *Format) Run() (err error) {
|
|||||||
|
|
||||||
// open the cache if configured
|
// open the cache if configured
|
||||||
if !f.NoCache {
|
if !f.NoCache {
|
||||||
if cache.Open(f.TreeRoot, f.ClearCache, f.formatters); err != nil {
|
if err = cache.Open(f.TreeRoot, f.ClearCache, f.formatters); err != nil {
|
||||||
return err
|
// 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
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user