|
@@ -1,6 +1,7 @@
|
|
package mdb
|
|
package mdb
|
|
|
|
|
|
import (
|
|
import (
|
|
|
|
+ "crypto/tls"
|
|
"github.com/go-redis/redis/v8"
|
|
"github.com/go-redis/redis/v8"
|
|
mhayaMongo "github.com/mhaya/components/mongo"
|
|
mhayaMongo "github.com/mhaya/components/mongo"
|
|
clog "github.com/mhaya/logger"
|
|
clog "github.com/mhaya/logger"
|
|
@@ -36,15 +37,15 @@ 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{
|
|
|
|
|
|
+ tlsConfig := &tls.Config{
|
|
MinVersion: tls.VersionTLS12,
|
|
MinVersion: tls.VersionTLS12,
|
|
PreferServerCipherSuites: true,
|
|
PreferServerCipherSuites: true,
|
|
- }*/
|
|
|
|
|
|
+ }
|
|
RDB = redis.NewUniversalClient(&redis.UniversalOptions{
|
|
RDB = redis.NewUniversalClient(&redis.UniversalOptions{
|
|
- Addrs: []string{redisConfig.GetString("address")},
|
|
|
|
- Password: redisConfig.GetString("password"),
|
|
|
|
- DB: redisConfig.GetInt("db"),
|
|
|
|
- // TLSConfig: tlsConfig,
|
|
|
|
|
|
+ Addrs: []string{redisConfig.GetString("address")},
|
|
|
|
+ Password: redisConfig.GetString("password"),
|
|
|
|
+ DB: redisConfig.GetInt("db"),
|
|
|
|
+ TLSConfig: tlsConfig,
|
|
})
|
|
})
|
|
|
|
|
|
if p.App().NodeId() == "m-center" {
|
|
if p.App().NodeId() == "m-center" {
|