Merge pull request #330 from numtide/feat/cache-fallback
Some checks failed
gh-pages / build (push) Waiting to run
gh-pages / deploy (push) Blocked by required conditions
Nix Flake Actions / nix-matrix (push) Has been cancelled
Nix Flake Actions / nix-build (push) Has been cancelled

feat: if we can't open the cache, fallback to no cache
This commit is contained in:
mergify[bot] 2024-07-03 10:24:53 +00:00 committed by GitHub
commit 45cc82c105
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -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
}
}