pull/103/head
Gordon 3 years ago
parent 6ec2993930
commit 66017df0b9

@ -63,20 +63,21 @@ func (mc *HistoryConsumerHandler) handleChatWs2Mongo(msg []byte, msgKey string)
log.Info("", "", "msg_transfer chat type = SingleChatType", isHistory, isPersist) log.Info("", "", "msg_transfer chat type = SingleChatType", isHistory, isPersist)
if isHistory { if isHistory {
if msgKey == pbSaveData.RecvID { if msgKey == pbSaveData.RecvID {
err := saveUserChat(pbData.RecvID, &pbSaveData) go func() {
if err != nil { err := saveUserChat(pbData.RecvID, &pbSaveData)
log.ErrorByKv("data insert to mongo err", pbSaveData.OperationID, "data", pbSaveData.String(), "err", err.Error()) if err != nil {
} log.ErrorByKv("data insert to mongo err", pbSaveData.OperationID, "data", pbSaveData.String(), "err", err.Error())
}
}()
} else if msgKey == pbSaveData.SendID { } else if msgKey == pbSaveData.SendID {
err := saveUserChat(pbData.SendID, &pbSaveData) go func() {
if err != nil { err := saveUserChat(pbData.SendID, &pbSaveData)
log.ErrorByKv("data insert to mongo err", pbSaveData.OperationID, "data", pbSaveData.String(), "err", err.Error()) if err != nil {
} log.ErrorByKv("data insert to mongo err", pbSaveData.OperationID, "data", pbSaveData.String(), "err", err.Error())
//if isSenderSync { }
// pbSaveData.ContentType = constant.SyncSenderMsg }()
// log.WarnByKv("SyncSenderMsg come here", pbData.OperationID, pbSaveData.String())
// sendMessageToPush(&pbSaveData)
//}
} }
log.NewInfo(pbSaveData.OperationID, "saveUserChat cost time ", utils.GetCurrentTimestampBySecond()-time) log.NewInfo(pbSaveData.OperationID, "saveUserChat cost time ", utils.GetCurrentTimestampBySecond()-time)

Loading…
Cancel
Save