add redis username

pull/255/head
Gordon 3 years ago
parent 5a423f88dd
commit d3b302ce66

@ -38,7 +38,7 @@ redis:
dbMaxIdle: 128
dbMaxActive: 0
dbIdleTimeout: 120
dbUserName:
dbUserName: im
dbPassWord: efH8BKAeUiWQL #redis密码 建议修改
enableCluster: true #如果外部redis以集群方式启动需要打开此开关

@ -123,8 +123,8 @@ func init() {
defer cancel()
if config.Config.Redis.EnableCluster {
DB.rdb = go_redis.NewClusterClient(&go_redis.ClusterOptions{
Addrs: config.Config.Redis.DBAddress,
//Username: config.Config.Redis.DBUserName,
Addrs: config.Config.Redis.DBAddress,
Username: config.Config.Redis.DBUserName,
Password: config.Config.Redis.DBPassWord, // no password set
PoolSize: 50,
})

Loading…
Cancel
Save