This commit is contained in:
Gordon 2022-05-11 18:54:22 +08:00
parent ab747d0338
commit 9a90c2e568
2 changed files with 2 additions and 1 deletions

View File

@ -4,6 +4,7 @@ import (
"Open_IM/pkg/common/config" "Open_IM/pkg/common/config"
"Open_IM/pkg/common/constant" "Open_IM/pkg/common/constant"
"Open_IM/pkg/common/kafka" "Open_IM/pkg/common/kafka"
"Open_IM/pkg/common/log"
"Open_IM/pkg/statistics" "Open_IM/pkg/statistics"
"fmt" "fmt"
"sync" "sync"
@ -30,6 +31,7 @@ func Init() {
w = new(sync.Mutex) w = new(sync.Mutex)
persistentCH.Init() persistentCH.Init()
historyCH.Init(cmdCh) historyCH.Init(cmdCh)
log.Debug("come msg transfer ts", config.Config.Kafka.ConsumerGroupID.MsgToMongoOffline, config.Config.Kafka.Ws2mschatOffline.Topic)
offlineHistoryCH.Init(cmdCh) offlineHistoryCH.Init(cmdCh)
statistics.NewStatistics(&singleMsgSuccessCount, config.Config.ModuleName.MsgTransferName, fmt.Sprintf("%d second singleMsgCount insert to mongo", constant.StatisticsTimeInterval), constant.StatisticsTimeInterval) statistics.NewStatistics(&singleMsgSuccessCount, config.Config.ModuleName.MsgTransferName, fmt.Sprintf("%d second singleMsgCount insert to mongo", constant.StatisticsTimeInterval), constant.StatisticsTimeInterval)
statistics.NewStatistics(&groupMsgCount, config.Config.ModuleName.MsgTransferName, fmt.Sprintf("%d second groupMsgCount insert to mongo", constant.StatisticsTimeInterval), constant.StatisticsTimeInterval) statistics.NewStatistics(&groupMsgCount, config.Config.ModuleName.MsgTransferName, fmt.Sprintf("%d second groupMsgCount insert to mongo", constant.StatisticsTimeInterval), constant.StatisticsTimeInterval)

View File

@ -19,7 +19,6 @@ type OfflineHistoryConsumerHandler struct {
} }
func (mc *OfflineHistoryConsumerHandler) Init(cmdCh chan Cmd2Value) { func (mc *OfflineHistoryConsumerHandler) Init(cmdCh chan Cmd2Value) {
log.Debug("ts", config.Config.Kafka.ConsumerGroupID.MsgToMongoOffline, config.Config.Kafka.Ws2mschatOffline.Topic)
mc.msgHandle = make(map[string]fcb) mc.msgHandle = make(map[string]fcb)
mc.cmdCh = cmdCh mc.cmdCh = cmdCh
mc.msgHandle[config.Config.Kafka.Ws2mschatOffline.Topic] = mc.handleChatWs2Mongo mc.msgHandle[config.Config.Kafka.Ws2mschatOffline.Topic] = mc.handleChatWs2Mongo