mirror of
https://github.com/krau/SaveAny-Bot.git
synced 2026-05-10 17:52:44 +08:00
fix: cache init after config
This commit is contained in:
5
common/cache/ristretto.go
vendored
5
common/cache/ristretto.go
vendored
@@ -11,7 +11,10 @@ import (
|
||||
|
||||
var cache *ristretto.Cache[string, any]
|
||||
|
||||
func init() {
|
||||
func Init() {
|
||||
if cache != nil {
|
||||
panic("cache already initialized")
|
||||
}
|
||||
c, err := ristretto.NewCache(&ristretto.Config[string, any]{
|
||||
NumCounters: config.Cfg.Cache.NumCounters,
|
||||
MaxCost: config.Cfg.Cache.MaxCost,
|
||||
|
||||
Reference in New Issue
Block a user