about summary refs log tree commit diff
path: root/app/models/user.rb
diff options
context:
space:
mode:
authorpluralcafe-docker <docker@plural.cafe>2018-08-20 02:29:25 +0000
committerpluralcafe-docker <docker@plural.cafe>2018-08-20 02:29:25 +0000
commitc339d49d82b3fd2873831029d9c92b3fbf1236e3 (patch)
tree5a8528475f089f1e592dfbedd37ee91e6f748ffc /app/models/user.rb
parentb6e9537de469a178ce195b75fe8eaf03735e785a (diff)
parentf4d28ccfa3f9fd38a6d219fcde2d1a8bfcf6b306 (diff)
Merge branch 'glitch'
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