Don't show warning about image cache disabled if pre-cache warmer is disabled

This commit is contained in:
Deluan
2020-12-02 08:52:35 -05:00
parent f2a8308925
commit 0aaa261a71
+3 -3
View File
@@ -57,9 +57,9 @@ func (w *warmer) waitForCacheReady(ctx context.Context) {
} }
func (w *warmer) Flush(ctx context.Context) { func (w *warmer) Flush(ctx context.Context) {
if conf.Server.DevPreCacheAlbumArtwork {
w.waitForCacheReady(ctx) w.waitForCacheReady(ctx)
if w.artworkCache.Available(ctx) { if w.artworkCache.Available(ctx) {
if conf.Server.DevPreCacheAlbumArtwork {
if w.pool == nil || len(w.albums) == 0 { if w.pool == nil || len(w.albums) == 0 {
return return
} }
@@ -67,9 +67,9 @@ func (w *warmer) Flush(ctx context.Context) {
for id := range w.albums { for id := range w.albums {
w.pool.Submit(artworkItem{albumID: id}) w.pool.Submit(artworkItem{albumID: id})
} }
}
} else { } else {
log.Warn(ctx, "Pre-cache warmer is not available as ImageCache is DISABLED") log.Warn(ctx, "Cache warmer is not available as ImageCache is DISABLED")
}
} }
w.albums = map[string]struct{}{} w.albums = map[string]struct{}{}
} }