diff options
author | Eugen Rochko <eugen@zeonfederated.com> | 2017-01-23 21:29:34 +0100 |
---|---|---|
committer | Eugen Rochko <eugen@zeonfederated.com> | 2017-01-23 21:29:34 +0100 |
commit | cca82bf0a2f0ccbf0feda00763fd7df0877845b6 (patch) | |
tree | 98afb883aa236dbeaf011944faa1548e7698deb7 /app/lib | |
parent | f392030ab82a70086f93bb02c3faab53c3fbd28e (diff) |
Move merging/unmerging of timelines into background. Move blocking into
background as well since it's a computationally expensive
Diffstat (limited to 'app/lib')
-rw-r--r-- | app/lib/feed_manager.rb | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/app/lib/feed_manager.rb b/app/lib/feed_manager.rb index 19f9dc16f..cdd26e69c 100644 --- a/app/lib/feed_manager.rb +++ b/app/lib/feed_manager.rb @@ -50,6 +50,15 @@ class FeedManager trim(:home, into_account.id) end + def unmerge_from_timeline(from_account, into_account) + timeline_key = key(:home, into_account.id) + + from_account.statuses.select('id').find_each do |status| + redis.zrem(timeline_key, status.id) + redis.zremrangebyscore(timeline_key, status.id, status.id) + end + end + def inline_render(target_account, template, object) rabl_scope = Class.new do include RoutingHelper |