mirror of
https://github.com/openimsdk/open-im-server.git
synced 2025-06-26 14:19:38 +08:00
Merge pull request #3438 from icey-yu/add-friend
fix: Add friend DB in notification sender
This commit is contained in:
commit
1b6d70e4a7
@ -103,22 +103,24 @@ func Start(ctx context.Context, config *Config, client discovery.SvcDiscoveryReg
|
|||||||
}
|
}
|
||||||
userClient := rpcli.NewUserClient(userConn)
|
userClient := rpcli.NewUserClient(userConn)
|
||||||
|
|
||||||
|
database := controller.NewFriendDatabase(
|
||||||
|
friendMongoDB,
|
||||||
|
friendRequestMongoDB,
|
||||||
|
redis.NewFriendCacheRedis(rdb, &config.LocalCacheConfig, friendMongoDB, redis.GetRocksCacheOptions()),
|
||||||
|
mgocli.GetTx(),
|
||||||
|
)
|
||||||
// Initialize notification sender
|
// Initialize notification sender
|
||||||
notificationSender := NewFriendNotificationSender(
|
notificationSender := NewFriendNotificationSender(
|
||||||
&config.NotificationConfig,
|
&config.NotificationConfig,
|
||||||
rpcli.NewMsgClient(msgConn),
|
rpcli.NewMsgClient(msgConn),
|
||||||
WithRpcFunc(userClient.GetUsersInfo),
|
WithRpcFunc(userClient.GetUsersInfo),
|
||||||
|
WithFriendDB(database),
|
||||||
)
|
)
|
||||||
localcache.InitLocalCache(&config.LocalCacheConfig)
|
localcache.InitLocalCache(&config.LocalCacheConfig)
|
||||||
|
|
||||||
// Register Friend server with refactored MongoDB and Redis integrations
|
// Register Friend server with refactored MongoDB and Redis integrations
|
||||||
relation.RegisterFriendServer(server, &friendServer{
|
relation.RegisterFriendServer(server, &friendServer{
|
||||||
db: controller.NewFriendDatabase(
|
db: database,
|
||||||
friendMongoDB,
|
|
||||||
friendRequestMongoDB,
|
|
||||||
redis.NewFriendCacheRedis(rdb, &config.LocalCacheConfig, friendMongoDB, redis.GetRocksCacheOptions()),
|
|
||||||
mgocli.GetTx(),
|
|
||||||
),
|
|
||||||
blackDatabase: controller.NewBlackDatabase(
|
blackDatabase: controller.NewBlackDatabase(
|
||||||
blackMongoDB,
|
blackMongoDB,
|
||||||
redis.NewBlackCacheRedis(rdb, &config.LocalCacheConfig, blackMongoDB, redis.GetRocksCacheOptions()),
|
redis.NewBlackCacheRedis(rdb, &config.LocalCacheConfig, blackMongoDB, redis.GetRocksCacheOptions()),
|
||||||
|
Loading…
x
Reference in New Issue
Block a user