|
|
@ -71,8 +71,8 @@ func StartTransfer(prometheusPort int) error {
|
|
|
|
msgMysModel := relation.NewChatLogGorm(db)
|
|
|
|
msgMysModel := relation.NewChatLogGorm(db)
|
|
|
|
chatLogDatabase := controller.NewChatLogDatabase(msgMysModel)
|
|
|
|
chatLogDatabase := controller.NewChatLogDatabase(msgMysModel)
|
|
|
|
msgDatabase := controller.NewCommonMsgDatabase(msgDocModel, msgModel, msgMysModel)
|
|
|
|
msgDatabase := controller.NewCommonMsgDatabase(msgDocModel, msgModel, msgMysModel)
|
|
|
|
conversationRpcClient := rpcclient.NewConversationRpcClient(client)
|
|
|
|
conversationRpcClient := rpcclient.NewConversationRPCClient(client)
|
|
|
|
groupRpcClient := rpcclient.NewGroupRpcClient(client)
|
|
|
|
groupRpcClient := rpcclient.NewGroupRPCClient(client)
|
|
|
|
msgTransfer := NewMsgTransfer(chatLogDatabase, msgDatabase, &conversationRpcClient, &groupRpcClient)
|
|
|
|
msgTransfer := NewMsgTransfer(chatLogDatabase, msgDatabase, &conversationRpcClient, &groupRpcClient)
|
|
|
|
msgTransfer.initPrometheus()
|
|
|
|
msgTransfer.initPrometheus()
|
|
|
|
return msgTransfer.Start(prometheusPort)
|
|
|
|
return msgTransfer.Start(prometheusPort)
|
|
|
@ -80,7 +80,7 @@ func StartTransfer(prometheusPort int) error {
|
|
|
|
|
|
|
|
|
|
|
|
func NewMsgTransfer(chatLogDatabase controller.ChatLogDatabase,
|
|
|
|
func NewMsgTransfer(chatLogDatabase controller.ChatLogDatabase,
|
|
|
|
msgDatabase controller.CommonMsgDatabase,
|
|
|
|
msgDatabase controller.CommonMsgDatabase,
|
|
|
|
conversationRpcClient *rpcclient.ConversationRpcClient, groupRpcClient *rpcclient.GroupRpcClient) *MsgTransfer {
|
|
|
|
conversationRpcClient *rpcclient.ConversationRPCClient, groupRpcClient *rpcclient.GroupRPCClient) *MsgTransfer {
|
|
|
|
return &MsgTransfer{
|
|
|
|
return &MsgTransfer{
|
|
|
|
persistentCH: NewPersistentConsumerHandler(chatLogDatabase),
|
|
|
|
persistentCH: NewPersistentConsumerHandler(chatLogDatabase),
|
|
|
|
historyCH: NewOnlineHistoryRedisConsumerHandler(msgDatabase, conversationRpcClient, groupRpcClient),
|
|
|
|
historyCH: NewOnlineHistoryRedisConsumerHandler(msgDatabase, conversationRpcClient, groupRpcClient),
|
|
|
|