Make caches singletons

This commit is contained in:
Deluan
2020-10-27 17:02:20 -04:00
parent 515528ee6d
commit 9b756faef5
6 changed files with 53 additions and 45 deletions
+1 -6
View File
@@ -5,7 +5,6 @@ import (
"context"
"image"
"io/ioutil"
"os"
"github.com/deluan/navidrome/conf"
"github.com/deluan/navidrome/log"
@@ -37,15 +36,11 @@ var _ = Describe("Artwork", func() {
BeforeEach(func() {
conf.Server.DataFolder, _ = ioutil.TempDir("", "file_caches")
conf.Server.ImageCacheSize = "100MB"
cache := NewImageCache()
cache := GetImageCache()
Eventually(func() bool { return cache.Ready() }).Should(BeTrue())
artwork = NewArtwork(ds, cache)
})
AfterEach(func() {
os.RemoveAll(conf.Server.DataFolder)
})
It("retrieves the external artwork art for an album", func() {
buf := new(bytes.Buffer)