🎧 Your Personal Streaming Service
Go airsonicmadsonicmedia-servermusicmusic-servernavidromeopensubsonicraspberry-piself-hostedstreamerstreaming-apistreaming-audiosubsonicsubsonic-server
Don't panic if fscache could not be initialized due to a FS error
Deluan467eb345ad9c
diff --git a/utils/cache/file_caches.go b/utils/cache/file_caches.goindex cb0566ac7..3be6b4fe1 100644--- a/utils/cache/file_caches.go+++ b/utils/cache/file_caches.go@@ -42,12 +42,13 @@ func NewFileCache(name, cacheSize, cacheFolder string, maxItems int, getReader Rcache, err := newFSCache(fc.name, fc.cacheSize, fc.cacheFolder, fc.maxItems)fc.mutex.Lock()defer fc.mutex.Unlock()- if err == nil {- fc.cache = cache- fc.disabled = cache == nil- }+ fc.cache = cache+ fc.disabled = cache == nil || err != nillog.Info("Finished initializing cache", "cache", fc.name, "maxSize", fc.cacheSize, "elapsedTime", time.Since(start))fc.ready = true+ if err != nil {+ log.Error(fmt.Sprintf("Cache %s will be DISABLED due to previous errors", "name"), fc.name, err)+ }if fc.disabled {log.Debug("Cache DISABLED", "cache", fc.name, "size", fc.cacheSize)}