diff options
author | Eugen Rochko <eugen@zeonfederated.com> | 2018-05-29 22:55:33 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-05-29 22:55:33 +0200 |
commit | 461542784b555237316f3dd5e32ea224cd3ab8ef (patch) | |
tree | be4e11efcf7842cdffebf1c559e98f06659329d1 /app/services/fan_out_on_write_service.rb | |
parent | 7706ed038f1a16d232635d564a28e6f90e53e0fd (diff) |
Reduce wasted work in RemoveStatusService due to inactive followers (#7672)
Diffstat (limited to 'app/services/fan_out_on_write_service.rb')
-rw-r--r-- | app/services/fan_out_on_write_service.rb | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/app/services/fan_out_on_write_service.rb b/app/services/fan_out_on_write_service.rb index 8b3630229..5efd3edb2 100644 --- a/app/services/fan_out_on_write_service.rb +++ b/app/services/fan_out_on_write_service.rb @@ -38,7 +38,7 @@ class FanOutOnWriteService < BaseService def deliver_to_followers(status) Rails.logger.debug "Delivering status #{status.id} to followers" - status.account.followers.where(domain: nil).joins(:user).where('users.current_sign_in_at > ?', User::ACTIVE_DURATION.ago).select(:id).reorder(nil).find_in_batches do |followers| + status.account.followers_for_local_distribution.select(:id).reorder(nil).find_in_batches do |followers| FeedInsertWorker.push_bulk(followers) do |follower| [status.id, follower.id, :home] end @@ -48,7 +48,7 @@ class FanOutOnWriteService < BaseService def deliver_to_lists(status) Rails.logger.debug "Delivering status #{status.id} to lists" - status.account.lists.joins(account: :user).where('users.current_sign_in_at > ?', User::ACTIVE_DURATION.ago).select(:id).reorder(nil).find_in_batches do |lists| + status.account.lists_for_local_distribution.select(:id).reorder(nil).find_in_batches do |lists| FeedInsertWorker.push_bulk(lists) do |list| [status.id, list.id, :list] end |