mirror of
https://github.com/AlistGo/alist.git
synced 2025-05-28 11:03:20 +08:00
✨ ali path and link
This commit is contained in:
@ -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)
|
||||
}
|
||||
|
Reference in New Issue
Block a user