mirror of
https://github.com/openimsdk/open-im-server.git
synced 2025-04-06 04:15:46 +08:00
Merge branch 'superGroup' of github.com:OpenIMSDK/Open-IM-Server into superGroup
This commit is contained in:
parent
59743ef071
commit
96d3ae86cc
@ -28,7 +28,7 @@ type DataBases struct {
|
|||||||
mgoSession *mgo.Session
|
mgoSession *mgo.Session
|
||||||
//redisPool *redis.Pool
|
//redisPool *redis.Pool
|
||||||
mongoClient *mongo.Client
|
mongoClient *mongo.Client
|
||||||
rdb *go_redis.ClusterClient
|
rdb *go_redis.Client
|
||||||
}
|
}
|
||||||
|
|
||||||
func key(dbAddress, dbName string) string {
|
func key(dbAddress, dbName string) string {
|
||||||
@ -112,17 +112,17 @@ func init() {
|
|||||||
// )
|
// )
|
||||||
// },
|
// },
|
||||||
//}
|
//}
|
||||||
//DB.rdb = go_redis.NewClient(&go_redis.Options{
|
DB.rdb = go_redis.NewClient(&go_redis.Options{
|
||||||
// Addr: config.Config.Redis.DBAddress,
|
Addr: config.Config.Redis.DBAddress,
|
||||||
// Password: config.Config.Redis.DBPassWord, // no password set
|
Password: config.Config.Redis.DBPassWord, // no password set
|
||||||
// DB: 0, // use default DB
|
DB: 0, // use default DB
|
||||||
// PoolSize: 100, // 连接池大小
|
PoolSize: 100, // 连接池大小
|
||||||
//})
|
|
||||||
DB.rdb = go_redis.NewClusterClient(&go_redis.ClusterOptions{
|
|
||||||
Addrs: []string{config.Config.Redis.DBAddress},
|
|
||||||
PoolSize: 50,
|
|
||||||
//Password: config.Config.Redis.DBPassWord,
|
|
||||||
})
|
})
|
||||||
|
//DB.rdb = go_redis.NewClusterClient(&go_redis.ClusterOptions{
|
||||||
|
// Addrs: []string{config.Config.Redis.DBAddress},
|
||||||
|
// PoolSize: 50,
|
||||||
|
//Password: config.Config.Redis.DBPassWord,
|
||||||
|
//})
|
||||||
ctx, cancel := context.WithTimeout(context.Background(), 5*time.Second)
|
ctx, cancel := context.WithTimeout(context.Background(), 5*time.Second)
|
||||||
defer cancel()
|
defer cancel()
|
||||||
_, err = DB.rdb.Ping(ctx).Result()
|
_, err = DB.rdb.Ping(ctx).Result()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user