mirror of
https://github.com/openimsdk/open-im-server.git
synced 2025-04-24 02:16:16 +08:00
fix bug
This commit is contained in:
parent
6e9dcdbb50
commit
c2e7863ca0
@ -28,11 +28,20 @@ func (d *DataBases) BatchInsertChat(userID string, msgList []*pbMsg.MsgDataToMQ,
|
|||||||
return utils.Wrap(err, "")
|
return utils.Wrap(err, "")
|
||||||
}
|
}
|
||||||
var remain uint64
|
var remain uint64
|
||||||
|
//if currentMaxSeq < uint64(GetSingleGocMsgNum()) {
|
||||||
|
// remain = uint64(GetSingleGocMsgNum()-1) - (currentMaxSeq % uint64(GetSingleGocMsgNum()))
|
||||||
|
//} else {
|
||||||
|
// remain = uint64(GetSingleGocMsgNum()) - ((currentMaxSeq - (uint64(GetSingleGocMsgNum()) - 1)) % uint64(GetSingleGocMsgNum()))
|
||||||
|
//}
|
||||||
|
|
||||||
|
blk0 := uint64(GetSingleGocMsgNum() - 1)
|
||||||
if currentMaxSeq < uint64(GetSingleGocMsgNum()) {
|
if currentMaxSeq < uint64(GetSingleGocMsgNum()) {
|
||||||
remain = uint64(GetSingleGocMsgNum()-1) - (currentMaxSeq % uint64(GetSingleGocMsgNum()))
|
remain = blk0 - currentMaxSeq
|
||||||
} else {
|
} else {
|
||||||
remain = uint64(GetSingleGocMsgNum()) - ((currentMaxSeq - (uint64(GetSingleGocMsgNum()) - 1)) % uint64(GetSingleGocMsgNum()))
|
excludeBlk0 := currentMaxSeq - blk0
|
||||||
|
remain = (uint64(GetSingleGocMsgNum()) - (excludeBlk0 % uint64(GetSingleGocMsgNum()))) % uint64(GetSingleGocMsgNum())
|
||||||
}
|
}
|
||||||
|
|
||||||
insertCounter := uint64(0)
|
insertCounter := uint64(0)
|
||||||
msgListToMongo := make([]MsgInfo, 0)
|
msgListToMongo := make([]MsgInfo, 0)
|
||||||
msgListToMongoNext := make([]MsgInfo, 0)
|
msgListToMongoNext := make([]MsgInfo, 0)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user