diff options
author | Eugen Rochko <eugen@zeonfederated.com> | 2018-05-05 00:54:24 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-05-05 00:54:24 +0200 |
commit | c73ce7b695aef1bbfe36bf674173d5a9fb988df5 (patch) | |
tree | ab1f94a5c72d70f2b978e4d1078e0f10ba488dbf /app/services | |
parent | ef7d64c80109074b39983b50cc8cf701c337cdcc (diff) |
Store home feeds for 7 days instead of 14 (#7354)
* Store home feeds for 7 days instead of 14 Reduces workload for status fan-out to active followers * Fix test for user model
Diffstat (limited to 'app/services')
-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 510b80c82..cb82a79ed 100644 --- a/app/services/fan_out_on_write_service.rb +++ b/app/services/fan_out_on_write_service.rb @@ -37,7 +37,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 > ?', 14.days.ago).select(:id).reorder(nil).find_in_batches do |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| FeedInsertWorker.push_bulk(followers) do |follower| [status.id, follower.id, :home] end @@ -47,7 +47,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 > ?', 14.days.ago).select(:id).reorder(nil).find_in_batches do |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| FeedInsertWorker.push_bulk(lists) do |list| [status.id, list.id, :list] end |