ali path and link

This commit is contained in:
微凉
2021-10-28 22:50:09 +08:00
parent 98f7dffed9
commit 0a50fbd080
13 changed files with 207 additions and 41 deletions

View File

@ -2,9 +2,9 @@ package bootstrap
import (
"github.com/Xhofe/alist/conf"
"github.com/allegro/bigcache/v3"
"github.com/eko/gocache/v2/cache"
"github.com/eko/gocache/v2/store"
goCache "github.com/patrickmn/go-cache"
log "github.com/sirupsen/logrus"
"time"
)
@ -12,9 +12,7 @@ import (
// InitCache init cache
func InitCache() {
log.Infof("init cache...")
bigCacheConfig := bigcache.DefaultConfig(60 * time.Minute)
bigCacheConfig.HardMaxCacheSize = 512
bigCacheClient, _ := bigcache.NewBigCache(bigCacheConfig)
bigCacheStore := store.NewBigcache(bigCacheClient, nil)
conf.Cache = cache.New(bigCacheStore)
}
goCacheClient := goCache.New(60*time.Minute, 120*time.Minute)
goCacheStore := store.NewGoCache(goCacheClient, nil)
conf.Cache = cache.New(goCacheStore)
}