Optimize MuteService and AfterBlockService (#2836)
This commit is contained in:
parent
496f466d73
commit
59804abc3d
5 changed files with 70 additions and 31 deletions
|
@ -76,6 +76,14 @@ class FeedManager
|
|||
end
|
||||
end
|
||||
|
||||
def clear_from_timeline(account, target_account)
|
||||
timeline_key = key(:home, account.id)
|
||||
timeline_status_ids = redis.zrange(timeline_key, 0, -1)
|
||||
target_status_ids = Status.where(id: timeline_status_ids, account: target_account).ids
|
||||
|
||||
redis.zrem(timeline_key, target_status_ids) if target_status_ids.present?
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
def redis
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue