pull/232/head
wenxu12345 3 years ago
parent 49cd31fd41
commit 1246f3aa21

@ -22,8 +22,8 @@ func saveUserChat(uid string, msg *pbMsg.MsgDataToMQ) error {
// return db.DB.SaveUserChatMongo2(uid, pbSaveData.MsgData.SendTime, &pbSaveData) // return db.DB.SaveUserChatMongo2(uid, pbSaveData.MsgData.SendTime, &pbSaveData)
} }
func saveUserChatList(userID string, msgList []*pbMsg.MsgDataToMQ, operationID string) error { func saveUserChatList(userID string, msgList []*pbMsg.MsgDataToMQ, operationID string) (error, uint64) {
log.Info(operationID, utils.GetSelfFuncName(), "args ", userID, len(msgList)) log.Info(operationID, utils.GetSelfFuncName(), "args ", userID, len(msgList))
//return db.DB.BatchInsertChat(userID, msgList, operationID) //return db.DB.BatchInsertChat(userID, msgList, operationID)
return db.DB.BatchInsertChatBoth(userID, msgList, operationID) return db.DB.BatchInsertChat2Cache(userID, msgList, operationID)
} }

@ -893,6 +893,10 @@ func getSeqUid(uid string, seq uint32) string {
return indexGen(uid, seqSuffix) return indexGen(uid, seqSuffix)
} }
func GetSeqUid(uid string, seq uint32) string {
return getSeqUid(uid, seq)
}
func getMsgIndex(seq uint32) int { func getMsgIndex(seq uint32) int {
seqSuffix := seq / singleGocMsgNum seqSuffix := seq / singleGocMsgNum
var index uint32 var index uint32

Loading…
Cancel
Save