0
0
Fork 0

Optimize MuteService and AfterBlockService (#2836)

This commit is contained in:
alpaca-tc 2017-05-06 23:31:07 +09:00 committed by Eugen Rochko
parent 496f466d73
commit 59804abc3d
5 changed files with 70 additions and 31 deletions

View file

@ -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