mirror of
https://github.com/openimsdk/open-im-server.git
synced 2026-05-03 00:25:59 +08:00
Clear personal chat history
This commit is contained in:
@@ -83,3 +83,16 @@ func (d *DataBases) NewSetMessageToCache(msgList []*pbChat.MsgDataToMQ, uid stri
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (d *DataBases) CleanUpOneUserAllMsgFromRedis(userID string) error {
|
||||
ctx := context.Background()
|
||||
key := messageCache + userID + "_" + "*"
|
||||
vals, err := d.rdb.Keys(ctx, key).Result()
|
||||
if err != nil {
|
||||
return utils.Wrap(err, "")
|
||||
}
|
||||
if err = d.rdb.Del(ctx, vals...).Err(); err != nil {
|
||||
return utils.Wrap(err, "")
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user