|
@@ -38,16 +38,25 @@ func (p *ActorDB) OnInit() {
|
|
clog.Panic("game_db_id not found")
|
|
clog.Panic("game_db_id not found")
|
|
}
|
|
}
|
|
redisConfig := cprofile.GetConfig("redis")
|
|
redisConfig := cprofile.GetConfig("redis")
|
|
- /* tlsConfig := &tls.Config{
|
|
|
|
- MinVersion: tls.VersionTLS12,
|
|
|
|
- PreferServerCipherSuites: true,
|
|
|
|
- }*/
|
|
|
|
- RDB = redis.NewUniversalClient(&redis.UniversalOptions{
|
|
|
|
- Addrs: []string{redisConfig.GetString("address")},
|
|
|
|
- Password: redisConfig.GetString("password"),
|
|
|
|
- DB: redisConfig.GetInt("db"),
|
|
|
|
- //TLSConfig: tlsConfig,
|
|
|
|
- })
|
|
|
|
|
|
+ tlsEnable := redisConfig.GetInt("tls")
|
|
|
|
+ if tlsEnable == 1 {
|
|
|
|
+ tlsConfig := &tls.Config{
|
|
|
|
+ MinVersion: tls.VersionTLS12,
|
|
|
|
+ PreferServerCipherSuites: true,
|
|
|
|
+ }
|
|
|
|
+ RDB = redis.NewUniversalClient(&redis.UniversalOptions{
|
|
|
|
+ Addrs: []string{redisConfig.GetString("address")},
|
|
|
|
+ Password: redisConfig.GetString("password"),
|
|
|
|
+ DB: redisConfig.GetInt("db"),
|
|
|
|
+ TLSConfig: tlsConfig,
|
|
|
|
+ })
|
|
|
|
+ } else {
|
|
|
|
+ RDB = redis.NewUniversalClient(&redis.UniversalOptions{
|
|
|
|
+ Addrs: []string{redisConfig.GetString("address")},
|
|
|
|
+ Password: redisConfig.GetString("password"),
|
|
|
|
+ DB: redisConfig.GetInt("db"),
|
|
|
|
+ })
|
|
|
|
+ }
|
|
|
|
|
|
if p.App().NodeId() == "m-center" {
|
|
if p.App().NodeId() == "m-center" {
|
|
SetIndex()
|
|
SetIndex()
|