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:
Brian McGee 2024-07-03 09:40:46 +01:00
parent 39bc4464b1
commit f266fc863b
No known key found for this signature in database
GPG Key ID: D49016E76AD1E8C0

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