about summary refs log tree commit diff
path: root/app/models/user.rb
diff options
context:
space:
mode:
authorThibG <thib@sitedethib.com>2018-08-19 09:46:26 +0200
committerGitHub <noreply@github.com>2018-08-19 09:46:26 +0200
commit484b9314e351fcab9e25b04c0024598433d2d688 (patch)
tree301ba59a7d214d5cf655263c95d731b9f18b6566 /app/models/user.rb
parent44e31c3e531e5c206003b7ed83ee1d6fdd3b2b53 (diff)
parent88a0395a58739ff0a4bc8ff79bc0b60ac2c0f736 (diff)
Merge pull request #652 from ThibG/glitch-soc/merge-upstream
Merge upstream changes
Diffstat (limited to 'app/models/user.rb')
-rw-r--r--app/models/user.rb9
1 files changed, 8 insertions, 1 deletions
diff --git a/app/models/user.rb b/app/models/user.rb
index 3e1b82962..8b65a900c 100644
--- a/app/models/user.rb
+++ b/app/models/user.rb
@@ -42,7 +42,14 @@ class User < ApplicationRecord
   include Settings::Extend
   include Omniauthable
 
-  ACTIVE_DURATION = 7.days
+  # The home and list feeds will be stored in Redis for this amount
+  # of time, and status fan-out to followers will include only people
+  # within this time frame. Lowering the duration may improve performance
+  # if lots of people sign up, but not a lot of them check their feed
+  # every day. Raising the duration reduces the amount of expensive
+  # RegenerationWorker jobs that need to be run when those people come
+  # to check their feed
+  ACTIVE_DURATION = ENV.fetch('USER_ACTIVE_DAYS', 7).to_i.days
 
   devise :two_factor_authenticatable,
          otp_secret_encryption_key: Rails.configuration.x.otp_secret