修改DB配置
This commit is contained in:
parent
e51aecbba8
commit
db575f5bc0
@ -29,6 +29,7 @@ var Server struct {
|
|||||||
RedisAddr string
|
RedisAddr string
|
||||||
RedisPort string
|
RedisPort string
|
||||||
RedisPwd string
|
RedisPwd string
|
||||||
|
RedisDb int
|
||||||
|
|
||||||
GameName string
|
GameName string
|
||||||
ServerType string
|
ServerType string
|
||||||
|
|||||||
@ -17,7 +17,7 @@ func InitRedis() {
|
|||||||
rdb := redis.NewClient(&redis.Options{
|
rdb := redis.NewClient(&redis.Options{
|
||||||
Addr: conf.Server.RedisAddr + ":" + conf.Server.RedisPort,
|
Addr: conf.Server.RedisAddr + ":" + conf.Server.RedisPort,
|
||||||
Password: conf.Server.RedisPwd, // no password set
|
Password: conf.Server.RedisPwd, // no password set
|
||||||
DB: 0,
|
DB: conf.Server.RedisDb,
|
||||||
})
|
})
|
||||||
|
|
||||||
_, err := rdb.Ping(ctx).Result()
|
_, err := rdb.Ping(ctx).Result()
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user