mirror of
https://github.com/openimsdk/open-im-server.git
synced 2025-04-06 04:15:46 +08:00
add global recv opt
This commit is contained in:
parent
d058cacb38
commit
e2f7dd67a2
@ -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.UniversalClient
|
rdb *go_redis.ClusterClient
|
||||||
}
|
}
|
||||||
|
|
||||||
type RedisClient struct {
|
type RedisClient struct {
|
||||||
@ -130,18 +130,19 @@ func init() {
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
panic(err.Error())
|
panic(err.Error())
|
||||||
}
|
}
|
||||||
} else {
|
|
||||||
DB.rdb = go_redis.NewClient(&go_redis.Options{
|
|
||||||
Addr: config.Config.Redis.DBAddress,
|
|
||||||
Password: config.Config.Redis.DBPassWord, // no password set
|
|
||||||
DB: 0, // use default DB
|
|
||||||
PoolSize: 100, // 连接池大小
|
|
||||||
})
|
|
||||||
_, err = DB.rdb.Ping(ctx).Result()
|
|
||||||
if err != nil {
|
|
||||||
panic(err.Error())
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
//} else {
|
||||||
|
// DB.rdb = go_redis.NewClient(&go_redis.Options{
|
||||||
|
// Addr: config.Config.Redis.DBAddress,
|
||||||
|
// Password: config.Config.Redis.DBPassWord, // no password set
|
||||||
|
// DB: 0, // use default DB
|
||||||
|
// PoolSize: 100, // 连接池大小
|
||||||
|
// })
|
||||||
|
// _, err = DB.rdb.Ping(ctx).Result()
|
||||||
|
// if err != nil {
|
||||||
|
// panic(err.Error())
|
||||||
|
// }
|
||||||
|
//}
|
||||||
}
|
}
|
||||||
|
|
||||||
func createMongoIndex(client *mongo.Client, collection string, isUnique bool, keys ...string) error {
|
func createMongoIndex(client *mongo.Client, collection string, isUnique bool, keys ...string) error {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user