mirror of
https://github.com/openimsdk/open-im-server.git
synced 2025-04-06 04:15:46 +08:00
Merge remote-tracking branch 'origin/tuoyun' into tuoyun
# Conflicts: # src/common/db/mongoModel.go
This commit is contained in:
commit
6ec2993930
@ -22,7 +22,6 @@ func key(dbAddress, dbName string) string {
|
|||||||
func init() {
|
func init() {
|
||||||
//mysql init
|
//mysql init
|
||||||
initMysqlDB()
|
initMysqlDB()
|
||||||
// mongo init
|
|
||||||
mgoDailInfo := &mgo.DialInfo{
|
mgoDailInfo := &mgo.DialInfo{
|
||||||
Addrs: config.Config.Mongo.DBAddress,
|
Addrs: config.Config.Mongo.DBAddress,
|
||||||
Direct: config.Config.Mongo.DBDirect,
|
Direct: config.Config.Mongo.DBDirect,
|
||||||
@ -40,6 +39,11 @@ func init() {
|
|||||||
DB.mgoSession = mgoSession
|
DB.mgoSession = mgoSession
|
||||||
DB.mgoSession.SetMode(mgo.Monotonic, true)
|
DB.mgoSession.SetMode(mgo.Monotonic, true)
|
||||||
|
|
||||||
|
c := DB.mgoSession.DB(config.Config.Mongo.DBDatabase).C(cChat)
|
||||||
|
err = c.EnsureIndexKey("uid")
|
||||||
|
if err != nil {
|
||||||
|
panic(err)
|
||||||
|
}
|
||||||
// redis pool init
|
// redis pool init
|
||||||
DB.redisPool = &redis.Pool{
|
DB.redisPool = &redis.Pool{
|
||||||
MaxIdle: config.Config.Redis.DBMaxIdle,
|
MaxIdle: config.Config.Redis.DBMaxIdle,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user