Merge branch 'v2.3.0release' of github.com:OpenIMSDK/Open-IM-Server into v2.3.0release

This commit is contained in:
wangchuxiao
2022-07-29 14:36:33 +08:00
16 changed files with 367 additions and 181 deletions
+14 -1
View File
@@ -88,7 +88,7 @@ func (d *DataBases) GetUserMinSeq(uid string) (uint64, error) {
return uint64(utils.StringToInt(seq)), err
}
func (d *DataBases) SetGroupUserMinSeq(groupID, userID string, minSeq uint32) (err error) {
func (d *DataBases) SetGroupUserMinSeq(groupID, userID string, minSeq uint64) (err error) {
key := groupUserMinSeq + "g:" + groupID + "u:" + userID
return d.RDB.Set(context.Background(), key, minSeq, 0).Err()
}
@@ -221,6 +221,19 @@ func (d *DataBases) SetMessageToCache(msgList []*pbChat.MsgDataToMQ, uid string,
_, err := pipe.Exec(ctx)
return err
}
func (d *DataBases) DeleteMessageFromCache(msgList []*pbChat.MsgDataToMQ, uid string, operationID string) error {
ctx := context.Background()
var keys []string
for _, msg := range msgList {
key := messageCache + uid + "_" + strconv.Itoa(int(msg.MsgData.Seq))
keys = append(keys, key)
}
err := d.RDB.Del(ctx, keys...).Err()
if err != nil {
log2.NewWarn(operationID, utils.GetSelfFuncName(), "redis failed", "args:", keys, uid, err.Error(), msgList)
}
return err
}
func (d *DataBases) CleanUpOneUserAllMsgFromRedis(userID string, operationID string) error {
ctx := context.Background()
+1 -1
View File
@@ -101,7 +101,7 @@ func (d *DataBases) BatchInsertChat2DB(userID string, msgList []*pbMsg.MsgDataTo
return utils.Wrap(err, "")
}
}
log.NewWarn(operationID, "batch mgo cost time ", getCurrentTimestampByMill()-newTime, userID, len(msgList))
log.Debug(operationID, "batch mgo cost time ", getCurrentTimestampByMill()-newTime, userID, len(msgList))
return nil
}