This commit is contained in:
Gordon
2022-05-09 18:23:06 +08:00
parent d5c9e08888
commit e2cacd9c4b
8 changed files with 37 additions and 28 deletions
+2 -2
View File
@@ -19,7 +19,7 @@ var (
pushCh PushConsumerHandler
pushTerminal []int32
producer *kafka.Producer
count uint64
successCount uint64
)
func Init(rpcPort int) {
@@ -30,7 +30,7 @@ func Init(rpcPort int) {
}
func init() {
producer = kafka.NewKafkaProducer(config.Config.Kafka.Ws2mschat.Addr, config.Config.Kafka.Ws2mschat.Topic)
statistics.NewStatistics(&count, config.Config.ModuleName.PushName, fmt.Sprintf("%d second push to msg_gateway count", 300), 300)
statistics.NewStatistics(&successCount, config.Config.ModuleName.PushName, fmt.Sprintf("%d second push to msg_gateway count", constant.StatisticsTimeInterval), constant.StatisticsTimeInterval)
}
func Run() {
+1 -1
View File
@@ -53,7 +53,7 @@ func MsgToUser(pushMsg *pbPush.PushMsgReq) {
}
}
log.NewInfo(pushMsg.OperationID, "push_result", wsResult, "sendData", pushMsg.MsgData)
count++
successCount++
if isOfflinePush && pushMsg.PushToUserID != pushMsg.MsgData.SendID {
for _, v := range wsResult {
if v.ResultCode == 0 {