75fd1904f3
Signed-off-by: Michael Mayer <michael@liquidbytes.net>
20 lines
261 B
Go
20 lines
261 B
Go
package service
|
|
|
|
import (
|
|
"sync"
|
|
"time"
|
|
|
|
gc "github.com/patrickmn/go-cache"
|
|
)
|
|
|
|
var onceCache sync.Once
|
|
|
|
func initCache() {
|
|
services.Cache = gc.New(336*time.Hour, 30*time.Minute)
|
|
}
|
|
|
|
func Cache() *gc.Cache {
|
|
onceCache.Do(initCache)
|
|
|
|
return services.Cache
|
|
}
|