Test: new changes in pkg: cache, cluster, conf

This commit is contained in:
HFO4
2022-03-26 15:32:57 +08:00
parent 1821923b74
commit 636ac52a3f
8 changed files with 144 additions and 137 deletions

4
pkg/cache/driver.go vendored
View File

@@ -10,7 +10,7 @@ import (
var Store Driver = NewMemoStore()
// Init 初始化缓存
func Init() {
func Init(isSlave bool) {
if conf.RedisConfig.Server != "" && gin.Mode() != gin.TestMode {
Store = NewRedisStore(
10,
@@ -21,7 +21,7 @@ func Init() {
)
}
if conf.SystemConfig.Mode == "slave" {
if isSlave {
err := Store.Sets(conf.OptionOverwrite, "setting_")
if err != nil {
util.Log().Warning("无法覆盖数据库设置: %s", err)