1Panel/backend/init/cache/cache.go
2022-08-17 09:37:30 +08:00

19 lines
330 B
Go

package cache
import (
"github.com/1Panel-dev/1Panel/global"
"github.com/1Panel-dev/1Panel/init/cache/badger_db"
"github.com/dgraph-io/badger/v3"
)
func Init() {
c := global.CONF.Cache
cache, err := badger.Open(badger.DefaultOptions(c.Path))
if err != nil {
panic(err)
}
global.CACHE = badger_db.NewCacheDB(cache)
}