mirror of
https://github.com/Mrs4s/go-cqhttp.git
synced 2025-05-04 19:17:37 +08:00
feat: load leveldb conf from environment variable. close #1002
This commit is contained in:
parent
a1e3c57488
commit
4b4193c6e3
@ -174,6 +174,12 @@ func Get() *Config {
|
||||
global.SetAtDefault(&config.Account.ReLogin.Disabled, !global.EnsureBool(os.Getenv("GCQ_RELOGIN"), false), false)
|
||||
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))
|
||||
dbConf := &LevelDBConfig{Enable: global.EnsureBool(os.Getenv("GCQ_LEVELDB"), true)}
|
||||
config.Database["leveldb"] = func() yaml.Node {
|
||||
n := &yaml.Node{}
|
||||
_ = n.Encode(dbConf)
|
||||
return *n
|
||||
}()
|
||||
accessTokenEnv := os.Getenv("GCQ_ACCESS_TOKEN")
|
||||
if os.Getenv("GCQ_HTTP_PORT") != "" {
|
||||
node := &yaml.Node{}
|
||||
|
Loading…
x
Reference in New Issue
Block a user