diff options
author | Akihiko Odaki (@fn_aki@pawoo.net) <akihiko.odaki.4i@stu.hosei.ac.jp> | 2017-07-11 08:00:01 +0900 |
---|---|---|
committer | Eugen Rochko <eugen@zeonfederated.com> | 2017-07-11 01:00:01 +0200 |
commit | 7bacdd718a143f54f47ddc3afa39504636be65c0 (patch) | |
tree | b8e80020a816e329f52cb1325b48c1fe455bdace /app/services | |
parent | 958fe0f7db6702d65791def89fceef77d6f43589 (diff) |
Fix PrecomputeFeedService for filtered statuses (#4148)
Diffstat (limited to 'app/services')
-rw-r--r-- | app/services/precompute_feed_service.rb | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/app/services/precompute_feed_service.rb b/app/services/precompute_feed_service.rb index a32ba1dae..85635a008 100644 --- a/app/services/precompute_feed_service.rb +++ b/app/services/precompute_feed_service.rb @@ -13,7 +13,7 @@ class PrecomputeFeedService < BaseService attr_reader :account def populate_feed - pairs = statuses.reverse_each.map(&method(:process_status)) + pairs = statuses.reverse_each.lazy.reject(&method(:status_filtered?)).map(&method(:process_status)).to_a redis.pipelined do redis.zadd(account_home_key, pairs) if pairs.any? @@ -22,7 +22,7 @@ class PrecomputeFeedService < BaseService end def process_status(status) - [status.id, status.reblog? ? status.reblog_of_id : status.id] unless status_filtered?(status) + [status.id, status.reblog? ? status.reblog_of_id : status.id] end def status_filtered?(status) |