diff --git a/api/config.tpl b/api/config.tpl index 81a8817..b2baa64 100644 --- a/api/config.tpl +++ b/api/config.tpl @@ -19,6 +19,9 @@ type Config struct { Port int `json:"port"` Password string `json:"password"` Database int `json:"database"` + TkDB int `json:"tkDB"` + CacheDB int `json:"cacheDB"` + CacheExpire int `json:"cacheExpire"` } Auth struct { AccessSecret string `json:"accessSecret"` diff --git a/api/context.tpl b/api/context.tpl index 5a7eb05..c35b068 100644 --- a/api/context.tpl +++ b/api/context.tpl @@ -30,7 +30,7 @@ func NewServiceContext(c {{.config}}) *ServiceContext { redisClient := redis.NewClient(&redis.Options{ Addr: fmt.Sprintf("%s:%d", c.Redis.Host, c.Redis.Port), Password: c.Redis.Password, // no password set - DB: c.Redis.DB, // use default DB + DB: c.Redis.TkDB, // use default DB }) _, err = redisClient.Ping(c.Context).Result() if err != nil {