mirror of
https://github.com/openimsdk/open-im-server.git
synced 2026-05-09 19:45:58 +08:00
fix bug
This commit is contained in:
@@ -2,6 +2,7 @@ package db
|
||||
|
||||
import (
|
||||
"Open_IM/pkg/common/config"
|
||||
"github.com/dtm-labs/rockscache"
|
||||
"go.mongodb.org/mongo-driver/x/bsonx"
|
||||
"strings"
|
||||
|
||||
@@ -29,6 +30,7 @@ type DataBases struct {
|
||||
//redisPool *redis.Pool
|
||||
mongoClient *mongo.Client
|
||||
rdb go_redis.UniversalClient
|
||||
Rc *rockscache.Client
|
||||
}
|
||||
|
||||
type RedisClient struct {
|
||||
@@ -142,6 +144,15 @@ func init() {
|
||||
panic(err.Error())
|
||||
}
|
||||
}
|
||||
|
||||
DB.rc = rockscache.NewClient(go_redis.NewClient(&go_redis.Options{
|
||||
Addr: config.Config.Redis.DBAddress[0],
|
||||
Password: config.Config.Redis.DBPassWord, // no password set
|
||||
DB: 0, // use default DB
|
||||
PoolSize: 100, // 连接池大小
|
||||
}), rockscache.NewDefaultOptions())
|
||||
DB.rc.Options.StrongConsistency = true
|
||||
|
||||
}
|
||||
|
||||
func createMongoIndex(client *mongo.Client, collection string, isUnique bool, keys ...string) error {
|
||||
|
||||
Reference in New Issue
Block a user