Use singleton in other places as well

This commit is contained in:
Deluan
2021-06-21 18:41:11 -04:00
parent 1f997357a9
commit 743e469795
7 changed files with 39 additions and 104 deletions
+1 -1
View File
@@ -32,7 +32,7 @@ type scrobbler struct {
playMap *ttlcache.Cache
}
func New(ds model.DataStore) Scrobbler {
func GetInstance(ds model.DataStore) Scrobbler {
instance := singleton.Get(scrobbler{}, func() interface{} {
m := ttlcache.NewCache()
m.SkipTTLExtensionOnHit(true)