mirror of
https://github.com/numtide/treefmt.git
synced 2024-10-03 20:18:11 +03:00
feat: if we can't open the cache, fallback to no cache
Signed-off-by: Brian McGee <brian@bmcgee.ie>
This commit is contained in:
parent
39bc4464b1
commit
f266fc863b
@ -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
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user