Cache Warmer now waits for Cache to be available

This commit is contained in:
Deluan 2020-10-31 00:35:20 -04:00
parent 145a5708ca
commit 58d6b0a84f
7 changed files with 42 additions and 20 deletions

View file

@ -52,7 +52,7 @@ func createScanner() scanner.Scanner {
dataStore := persistence.New()
artworkCache := core.GetImageCache()
artwork := core.NewArtwork(dataStore, artworkCache)
cacheWarmer := core.NewCacheWarmer(artwork)
cacheWarmer := core.NewCacheWarmer(artwork, artworkCache)
scannerScanner := scanner.New(dataStore, cacheWarmer)
return scannerScanner
}
@ -61,6 +61,7 @@ func createScanner() scanner.Scanner {
var allProviders = wire.NewSet(core.Set, subsonic.New, app.New, persistence.New)
// Scanner must be a Singleton
var (
onceScanner sync.Once
scannerInstance scanner.Scanner