mirror of
https://github.com/openimsdk/open-im-server.git
synced 2025-04-26 11:36:44 +08:00
script
This commit is contained in:
parent
7789b2251a
commit
6d4cee96c8
@ -76,6 +76,9 @@ func NewGroupDatabase(
|
|||||||
}
|
}
|
||||||
|
|
||||||
func InitGroupDatabase(db *gorm.DB, rdb redis.UniversalClient, database *mongo.Database) GroupDatabase {
|
func InitGroupDatabase(db *gorm.DB, rdb redis.UniversalClient, database *mongo.Database) GroupDatabase {
|
||||||
|
rcOptions := rockscache.NewDefaultOptions()
|
||||||
|
rcOptions.StrongConsistency = true
|
||||||
|
rcOptions.RandomExpireAdjustment = 0.2
|
||||||
return NewGroupDatabase(
|
return NewGroupDatabase(
|
||||||
relation.NewGroupDB(db),
|
relation.NewGroupDB(db),
|
||||||
relation.NewGroupMemberDB(db),
|
relation.NewGroupMemberDB(db),
|
||||||
@ -83,10 +86,7 @@ func InitGroupDatabase(db *gorm.DB, rdb redis.UniversalClient, database *mongo.D
|
|||||||
tx.NewGorm(db),
|
tx.NewGorm(db),
|
||||||
tx.NewMongo(database.Client()),
|
tx.NewMongo(database.Client()),
|
||||||
unrelation.NewSuperGroupMongoDriver(database),
|
unrelation.NewSuperGroupMongoDriver(database),
|
||||||
cache.NewGroupCacheRedis(rdb, relation.NewGroupDB(db), relation.NewGroupMemberDB(db), relation.NewGroupRequest(db), unrelation.NewSuperGroupMongoDriver(database), rockscache.Options{
|
cache.NewGroupCacheRedis(rdb, relation.NewGroupDB(db), relation.NewGroupMemberDB(db), relation.NewGroupRequest(db), unrelation.NewSuperGroupMongoDriver(database), rcOptions),
|
||||||
StrongConsistency: true,
|
|
||||||
RandomExpireAdjustment: 2.0,
|
|
||||||
}),
|
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user