1
0
mirror of https://github.com/Mrs4s/go-cqhttp.git synced 2025-05-05 03:23:49 +08:00

fix: 修复环境变量初始化错误

Close #1025
This commit is contained in:
MiaoWoo 2021-08-26 17:08:32 +08:00 committed by GitHub
parent bf77951f8d
commit 346e01c4e9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -175,6 +175,7 @@ func Get() *Config {
global.SetAtDefault(&config.Account.ReLogin.Delay, uint(toInt64(os.Getenv("GCQ_RELOGIN_DELAY"))), uint(0)) global.SetAtDefault(&config.Account.ReLogin.Delay, uint(toInt64(os.Getenv("GCQ_RELOGIN_DELAY"))), uint(0))
global.SetAtDefault(&config.Account.ReLogin.MaxTimes, uint(toInt64(os.Getenv("GCQ_RELOGIN_MAX_TIMES"))), uint(0)) global.SetAtDefault(&config.Account.ReLogin.MaxTimes, uint(toInt64(os.Getenv("GCQ_RELOGIN_MAX_TIMES"))), uint(0))
dbConf := &LevelDBConfig{Enable: global.EnsureBool(os.Getenv("GCQ_LEVELDB"), true)} dbConf := &LevelDBConfig{Enable: global.EnsureBool(os.Getenv("GCQ_LEVELDB"), true)}
config.Database = make(map[string]yaml.Node)
config.Database["leveldb"] = func() yaml.Node { config.Database["leveldb"] = func() yaml.Node {
n := &yaml.Node{} n := &yaml.Node{}
_ = n.Encode(dbConf) _ = n.Encode(dbConf)