Commit 8ee525e9 authored by hujiebin's avatar hujiebin

清理房间访客

parent 298be3eb
......@@ -59,3 +59,13 @@ func GetUserRecentRooms(model *domain.Model, userId uint64) (imGroupIds []string
}
return
}
// 清理房间访客
// 15天前访问的
func RemoveRoomVisitors(model *domain.Model, imGroupId string) {
groupKey := group_k.GetUserEnterRoomGroupKey(imGroupId)
err := model.Redis.ZRemRangeByScore(model, groupKey, "-inf", fmt.Sprintf("%d", time.Now().AddDate(0, 0, -15).Unix())).Err()
if err != nil {
model.Log.Errorf("RemoveRoomVisitors fail:%v", err)
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment