From 4f1d8636154d8f445eadec5ce3906f06324b0176 Mon Sep 17 00:00:00 2001 From: Eugen Rochko Date: Thu, 24 Nov 2016 18:17:58 +0100 Subject: Only distribute statuses to followers who signed in in the last 2 weeks, add rake task for clearing feeds of inactive users --- app/services/fan_out_on_write_service.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'app/services') diff --git a/app/services/fan_out_on_write_service.rb b/app/services/fan_out_on_write_service.rb index 78cb0b13f..78301c6ca 100644 --- a/app/services/fan_out_on_write_service.rb +++ b/app/services/fan_out_on_write_service.rb @@ -24,7 +24,7 @@ class FanOutOnWriteService < BaseService def deliver_to_followers(status) Rails.logger.debug "Delivering status #{status.id} to followers" - status.account.followers.where(domain: nil).find_each do |follower| + status.account.followers.where(domain: nil).joins(:user).where('users.current_sign_in_at > ?', 14.days.ago).find_each do |follower| next if FeedManager.instance.filter?(:home, status, follower) FeedManager.instance.push(:home, follower, status) end -- cgit