This commit is contained in:
skiffer-git 2022-05-18 08:06:05 +08:00
parent 424f854145
commit de9c2d3d85
3 changed files with 6 additions and 0 deletions

View File

@ -24,6 +24,8 @@ var (
singleMsgSuccessCount uint64 singleMsgSuccessCount uint64
groupMsgCount uint64 groupMsgCount uint64
singleMsgFailedCount uint64 singleMsgFailedCount uint64
singleMsgSuccessCountMutex sync.Mutex
) )
func Init() { func Init() {

View File

@ -53,7 +53,9 @@ func (mc *OfflineHistoryConsumerHandler) handleChatWs2Mongo(msg []byte, msgKey s
log.NewError(operationID, "single data insert to mongo err", err.Error(), msgFromMQ.String()) log.NewError(operationID, "single data insert to mongo err", err.Error(), msgFromMQ.String())
return return
} }
singleMsgSuccessCountMutex.Lock()
singleMsgSuccessCount++ singleMsgSuccessCount++
singleMsgSuccessCountMutex.Unlock()
log.NewDebug(msgFromMQ.OperationID, "sendMessageToPush cost time ", time.Since(now)) log.NewDebug(msgFromMQ.OperationID, "sendMessageToPush cost time ", time.Since(now))
} }
if !isSenderSync && msgKey == msgFromMQ.MsgData.SendID { if !isSenderSync && msgKey == msgFromMQ.MsgData.SendID {

View File

@ -86,7 +86,9 @@ func (och *OnlineHistoryConsumerHandler) handleChatWs2Mongo(msg []byte, msgKey s
log.NewError(operationID, "single data insert to mongo err", err.Error(), msgFromMQ.String()) log.NewError(operationID, "single data insert to mongo err", err.Error(), msgFromMQ.String())
return return
} }
singleMsgSuccessCountMutex.Lock()
singleMsgSuccessCount++ singleMsgSuccessCount++
singleMsgSuccessCountMutex.Unlock()
log.NewDebug(msgFromMQ.OperationID, "sendMessageToPush cost time ", time.Since(now)) log.NewDebug(msgFromMQ.OperationID, "sendMessageToPush cost time ", time.Since(now))
} }
if !isSenderSync && msgKey == msgFromMQ.MsgData.SendID { if !isSenderSync && msgKey == msgFromMQ.MsgData.SendID {