1Panel/backend/init/cache/cache.go

19 lines
330 B
Go
Raw Normal View History

2022-08-16 23:30:23 +08:00
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)
}