mirror of
https://github.com/navidrome/navidrome.git
synced 2025-04-16 04:00:38 +03:00
Don't panic if fscache could not be initialized due to a FS error
This commit is contained in:
parent
31b553e972
commit
467eb345ad
9
utils/cache/file_caches.go
vendored
9
utils/cache/file_caches.go
vendored
@ -42,12 +42,13 @@ func NewFileCache(name, cacheSize, cacheFolder string, maxItems int, getReader R
|
||||
cache, 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 != nil
|
||||
log.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)
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user