mirror of
https://github.com/openimsdk/open-im-server.git
synced 2025-08-07 19:50:07 +08:00
Merge remote-tracking branch 'origin/tuoyun' into tuoyun
This commit is contained in:
commit
6c5629a0d7
@ -27,13 +27,14 @@ func (d *DataBases) BatchInsertChat(userID string, msgList []*pbMsg.MsgDataToMQ,
|
|||||||
return utils.Wrap(err, "")
|
return utils.Wrap(err, "")
|
||||||
}
|
}
|
||||||
|
|
||||||
remain := currentMaxSeq % uint64(GetSingleGocMsgNum())
|
//4999
|
||||||
|
remain := uint64(GetSingleGocMsgNum()) - (currentMaxSeq % uint64(GetSingleGocMsgNum()))
|
||||||
insertCounter := uint64(0)
|
insertCounter := uint64(0)
|
||||||
msgListToMongo := make([]MsgInfo, 0)
|
msgListToMongo := make([]MsgInfo, 0)
|
||||||
msgListToMongoNext := make([]MsgInfo, 0)
|
msgListToMongoNext := make([]MsgInfo, 0)
|
||||||
seqUid := ""
|
seqUid := ""
|
||||||
seqUidNext := ""
|
seqUidNext := ""
|
||||||
log.Debug(operationID, "remain ", remain, "insertCounter ", insertCounter, "currentMaxSeq ", currentMaxSeq)
|
log.Debug(operationID, "remain ", remain, "insertCounter ", insertCounter, "currentMaxSeq ", currentMaxSeq, userID)
|
||||||
for _, m := range msgList {
|
for _, m := range msgList {
|
||||||
currentMaxSeq++
|
currentMaxSeq++
|
||||||
sMsg := MsgInfo{}
|
sMsg := MsgInfo{}
|
||||||
@ -77,5 +78,5 @@ func (d *DataBases) BatchInsertChat(userID string, msgList []*pbMsg.MsgDataToMQ,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
log.NewWarn(operationID, "batch mgo cost time ", getCurrentTimestampByMill()-newTime, userID, len(msgList))
|
log.NewWarn(operationID, "batch mgo cost time ", getCurrentTimestampByMill()-newTime, userID, len(msgList))
|
||||||
return utils.Wrap(d.SetUserMaxSeq(userID, uint32(currentMaxSeq)), "")
|
return utils.Wrap(d.SetUserMaxSeq(userID, uint64(currentMaxSeq)), "")
|
||||||
}
|
}
|
||||||
|
@ -69,9 +69,9 @@ func (d *DataBases) GetUserMaxSeq(uid string) (uint64, error) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
//set the largest Seq
|
//set the largest Seq
|
||||||
func (d *DataBases) SetUserMaxSeq(uid string, maxSeq uint32) error {
|
func (d *DataBases) SetUserMaxSeq(uid string, maxSeq uint64) error {
|
||||||
key := userIncrSeq + uid
|
key := userIncrSeq + uid
|
||||||
_, err := redis.Uint64(d.Exec("SET", key, maxSeq))
|
_, err := d.Exec("SET", key, maxSeq)
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user