This commit is contained in:
wangchuxiao
2023-03-13 15:39:47 +08:00
parent 6187b15a88
commit eb946ad181
18 changed files with 82 additions and 128 deletions
+5 -8
View File
@@ -35,15 +35,12 @@ func Start(client discoveryregistry.SvcDiscoveryRegistry, server *grpc.Server) e
if err != nil {
return err
}
opts := rockscache.NewDefaultOptions()
opts.RandomExpireAdjustment = 0.2
opts.StrongConsistency = true
pbConversation.RegisterConversationServer(server, &conversationServer{
groupChecker: check.NewGroupChecker(client),
ConversationDatabase: controller.NewConversationDatabase(relation.NewConversationGorm(db), cache.NewConversationRedis(rdb, rockscache.Options{
RandomExpireAdjustment: 0.2,
DisableCacheRead: false,
DisableCacheDelete: false,
StrongConsistency: true,
}), tx.NewGorm(db)),
groupChecker: check.NewGroupChecker(client),
ConversationDatabase: controller.NewConversationDatabase(relation.NewConversationGorm(db), cache.NewConversationRedis(rdb, opts), tx.NewGorm(db)),
})
return nil
}