2022-10-15 21:54:11 +02:00
|
|
|
package get
|
2021-01-08 13:29:01 +01:00
|
|
|
|
|
|
|
import (
|
|
|
|
"sync"
|
|
|
|
"time"
|
|
|
|
|
|
|
|
gc "github.com/patrickmn/go-cache"
|
|
|
|
)
|
|
|
|
|
|
|
|
var onceFolderCache sync.Once
|
|
|
|
|
|
|
|
func initFolderCache() {
|
|
|
|
services.FolderCache = gc.New(time.Minute*15, 5*time.Minute)
|
|
|
|
}
|
|
|
|
|
|
|
|
func FolderCache() *gc.Cache {
|
|
|
|
onceFolderCache.Do(initFolderCache)
|
|
|
|
|
|
|
|
return services.FolderCache
|
|
|
|
}
|