|
|
@ -45,7 +45,7 @@ func (mc *HistoryConsumerHandler) handleChatWs2Mongo(msg []byte, msgKey string)
|
|
|
|
isHistory := utils.GetSwitchFromOptions(msgFromMQ.MsgData.Options, constant.IsHistory)
|
|
|
|
isHistory := utils.GetSwitchFromOptions(msgFromMQ.MsgData.Options, constant.IsHistory)
|
|
|
|
//Control whether to store history messages (mysql)
|
|
|
|
//Control whether to store history messages (mysql)
|
|
|
|
isPersist := utils.GetSwitchFromOptions(msgFromMQ.MsgData.Options, constant.IsPersistent)
|
|
|
|
isPersist := utils.GetSwitchFromOptions(msgFromMQ.MsgData.Options, constant.IsPersistent)
|
|
|
|
//isSenderSync := utils.GetSwitchFromOptions(msgFromMQ.MsgData.Options, constant.IsSenderSync)
|
|
|
|
isSenderSync := utils.GetSwitchFromOptions(msgFromMQ.MsgData.Options, constant.IsSenderSync)
|
|
|
|
switch msgFromMQ.MsgData.SessionType {
|
|
|
|
switch msgFromMQ.MsgData.SessionType {
|
|
|
|
case constant.SingleChatType:
|
|
|
|
case constant.SingleChatType:
|
|
|
|
log.NewDebug(msgFromMQ.OperationID, "msg_transfer msg type = SingleChatType", isHistory, isPersist)
|
|
|
|
log.NewDebug(msgFromMQ.OperationID, "msg_transfer msg type = SingleChatType", isHistory, isPersist)
|
|
|
@ -57,7 +57,10 @@ func (mc *HistoryConsumerHandler) handleChatWs2Mongo(msg []byte, msgKey string)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
log.NewDebug(msgFromMQ.OperationID, "sendMessageToPush cost time ", utils.GetCurrentTimestampByNano()-time)
|
|
|
|
log.NewDebug(msgFromMQ.OperationID, "sendMessageToPush cost time ", utils.GetCurrentTimestampByNano()-time)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
go sendMessageToPush(&msgFromMQ, msgKey)
|
|
|
|
if !isSenderSync && msgKey == msgFromMQ.MsgData.SendID {
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
go sendMessageToPush(&msgFromMQ, msgKey)
|
|
|
|
|
|
|
|
}
|
|
|
|
log.NewDebug(operationID, "saveUserChat cost time ", utils.GetCurrentTimestampByNano()-time)
|
|
|
|
log.NewDebug(operationID, "saveUserChat cost time ", utils.GetCurrentTimestampByNano()-time)
|
|
|
|
case constant.GroupChatType:
|
|
|
|
case constant.GroupChatType:
|
|
|
|
log.NewDebug(msgFromMQ.OperationID, "msg_transfer msg type = GroupChatType", isHistory, isPersist)
|
|
|
|
log.NewDebug(msgFromMQ.OperationID, "msg_transfer msg type = GroupChatType", isHistory, isPersist)
|
|
|
|