batch to mongo

pull/232/head
skiffer-git 3 years ago
parent 0fbc1095be
commit ea8638c843

@ -33,7 +33,7 @@ func (d *DataBases) BatchInsertChat(userID string, msgList []*pbMsg.MsgDataToMQ,
msgListToMongoNext := make([]MsgInfo, 0)
seqUid := ""
seqUidNext := ""
log.Debug(operationID, "remain ", remain, "insertCounter ", insertCounter, "currentMaxSeq ", currentMaxSeq)
log.Debug(operationID, "remain ", remain, "insertCounter ", insertCounter, "currentMaxSeq ", currentMaxSeq, userID)
for _, m := range msgList {
currentMaxSeq++
sMsg := MsgInfo{}
@ -77,5 +77,5 @@ func (d *DataBases) BatchInsertChat(userID string, msgList []*pbMsg.MsgDataToMQ,
}
}
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,7 +69,7 @@ func (d *DataBases) GetUserMaxSeq(uid string) (uint64, error) {
}
//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
_, err := redis.Uint64(d.Exec("SET", key, maxSeq))
return err

Loading…
Cancel
Save