2022-10-15 21:54:11 +02:00
|
|
|
package get
|
2021-01-08 12:20:41 +01:00
|
|
|
|
|
|
|
import (
|
|
|
|
"sync"
|
|
|
|
"time"
|
|
|
|
|
|
|
|
gc "github.com/patrickmn/go-cache"
|
|
|
|
)
|
|
|
|
|
|
|
|
var onceCoverCache sync.Once
|
|
|
|
|
|
|
|
func initCoverCache() {
|
|
|
|
services.CoverCache = gc.New(time.Hour, 10*time.Minute)
|
|
|
|
}
|
|
|
|
|
|
|
|
func CoverCache() *gc.Cache {
|
|
|
|
onceCoverCache.Do(initCoverCache)
|
|
|
|
|
|
|
|
return services.CoverCache
|
|
|
|
}
|