Make caches singletons

This commit is contained in:
Deluan
2020-10-25 22:49:37 -04:00
parent 1e56f4da76
commit 81d7556cdf
4 changed files with 46 additions and 30 deletions
+1 -3
View File
@@ -14,10 +14,9 @@ type CacheWarmer interface {
Flush(ctx context.Context)
}
func NewCacheWarmer(cache ArtworkCache, artwork Artwork) CacheWarmer {
func NewCacheWarmer(artwork Artwork) CacheWarmer {
w := &warmer{
artwork: artwork,
cache: cache,
albums: map[string]struct{}{},
}
p, err := pool.NewPool("artwork", 3, &artworkItem{}, w.execute)
@@ -33,7 +32,6 @@ func NewCacheWarmer(cache ArtworkCache, artwork Artwork) CacheWarmer {
type warmer struct {
pool *pool.Pool
artwork Artwork
cache ArtworkCache
albums map[string]struct{}
}