2022-10-15 21:54:11 +02:00
|
|
|
package get
|
2021-01-08 12:52:26 +01:00
|
|
|
|
|
|
|
import (
|
|
|
|
"sync"
|
|
|
|
"time"
|
|
|
|
|
|
|
|
gc "github.com/patrickmn/go-cache"
|
|
|
|
)
|
|
|
|
|
|
|
|
var onceThumbCache sync.Once
|
|
|
|
|
|
|
|
func initThumbCache() {
|
2021-01-08 13:29:01 +01:00
|
|
|
services.ThumbCache = gc.New(time.Hour*24, 10*time.Minute)
|
2021-01-08 12:52:26 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
func ThumbCache() *gc.Cache {
|
|
|
|
onceThumbCache.Do(initThumbCache)
|
|
|
|
|
|
|
|
return services.ThumbCache
|
|
|
|
}
|