From f266fc863bc970313e29fc1fa6f581e67f97ad30 Mon Sep 17 00:00:00 2001 From: Brian McGee Date: Wed, 3 Jul 2024 09:40:46 +0100 Subject: [PATCH] feat: if we can't open the cache, fallback to no cache Signed-off-by: Brian McGee --- cli/format.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/cli/format.go b/cli/format.go index 8ccf578..bce3622 100644 --- a/cli/format.go +++ b/cli/format.go @@ -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 } }