fix: 解决部分情况下缓存目录导致启动失败的问题 (#6364)
Some checks failed
Build Test / build-linux-binary (push) Failing after -8m36s
Build / SonarCloud (push) Failing after -8m40s
sync2gitee / repo-sync (push) Failing after -8m40s

Refs https://github.com/1Panel-dev/1Panel/issues/6362
This commit is contained in:
zhengkunwang 2024-09-04 17:21:43 +08:00 committed by GitHub
parent 228e3d9ae3
commit a397cab61c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -1,6 +1,7 @@
package cache
import (
"os"
"time"
"github.com/1Panel-dev/1Panel/backend/global"
@ -10,7 +11,8 @@ import (
func Init() {
c := global.CONF.System.Cache
_ = os.RemoveAll(c)
_ = os.Mkdir(c, 0644)
options := badger.Options{
Dir: c,
ValueDir: c,