about summary refs log tree commit diff
path: root/app/services/fan_out_on_write_service.rb
diff options
context:
space:
mode:
authorThibG <thib@sitedethib.com>2018-05-10 00:28:54 +0200
committerGitHub <noreply@github.com>2018-05-10 00:28:54 +0200
commit34142ab29c33104793afe3199f102d84b83b9b57 (patch)
treeafba23a3f169d7445f80ffe555985a295c98f6e1 /app/services/fan_out_on_write_service.rb
parent143878d9dadd03347c54c9261b9bc754a1d0f5bc (diff)
parent5d8052e7156c913a551b923c51d508b1ea8837b3 (diff)
Merge pull request #472 from ThibG/glitch-soc/merge
Merge upstream changes
Diffstat (limited to 'app/services/fan_out_on_write_service.rb')
-rw-r--r--app/services/fan_out_on_write_service.rb4
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