mirror of
https://github.com/openimsdk/open-im-server.git
synced 2025-04-06 04:15:46 +08:00
mutex
This commit is contained in:
parent
424f854145
commit
de9c2d3d85
@ -24,6 +24,8 @@ var (
|
|||||||
singleMsgSuccessCount uint64
|
singleMsgSuccessCount uint64
|
||||||
groupMsgCount uint64
|
groupMsgCount uint64
|
||||||
singleMsgFailedCount uint64
|
singleMsgFailedCount uint64
|
||||||
|
|
||||||
|
singleMsgSuccessCountMutex sync.Mutex
|
||||||
)
|
)
|
||||||
|
|
||||||
func Init() {
|
func Init() {
|
||||||
|
@ -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 {
|
||||||
|
@ -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 {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user