diff options
author | alpaca-tc <alpaca-tc@alpaca.tc> | 2017-05-06 23:31:07 +0900 |
---|---|---|
committer | Eugen Rochko <eugen@zeonfederated.com> | 2017-05-06 16:31:07 +0200 |
commit | 59804abc3d59070e56e0c541884a54fb88242eb2 (patch) | |
tree | 16054c3973616a7066a931e6607a59cad8cacb8c /app/lib/feed_manager.rb | |
parent | 496f466d73610f24821d7806541c749e8e5dda97 (diff) |
Optimize MuteService and AfterBlockService (#2836)
Diffstat (limited to 'app/lib/feed_manager.rb')
-rw-r--r-- | app/lib/feed_manager.rb | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/app/lib/feed_manager.rb b/app/lib/feed_manager.rb index 339a5c78b..aaff9acd3 100644 --- a/app/lib/feed_manager.rb +++ b/app/lib/feed_manager.rb @@ -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 |