From 38317c549794b07d8ff170f94709ca6b502dc6b1 Mon Sep 17 00:00:00 2001 From: Gordon <1432970085@qq.com> Date: Fri, 20 May 2022 20:10:24 +0800 Subject: [PATCH] concurrent consumption of messages --- pkg/common/db/batch_insert_chat.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/common/db/batch_insert_chat.go b/pkg/common/db/batch_insert_chat.go index 64d2d342b..9b78c8822 100644 --- a/pkg/common/db/batch_insert_chat.go +++ b/pkg/common/db/batch_insert_chat.go @@ -32,7 +32,7 @@ func (d *DataBases) BatchInsertChat(userID string, msgList []*pbMsg.MsgDataToMQ, if currentMaxSeq < uint64(GetSingleGocMsgNum()) { remain = uint64(GetSingleGocMsgNum()-1) - (currentMaxSeq % uint64(GetSingleGocMsgNum())) } else { - remain = uint64(GetSingleGocMsgNum()) - (currentMaxSeq % uint64(GetSingleGocMsgNum())) + remain = uint64(GetSingleGocMsgNum()) - ((currentMaxSeq - 4999) % uint64(GetSingleGocMsgNum())) } insertCounter := uint64(0) msgListToMongo := make([]MsgInfo, 0)