Only call regeneration worker after first login after a 14 day break
This commit is contained in:
parent
4c53af64f0
commit
b510a56c0c
4 changed files with 19 additions and 13 deletions
|
@ -39,7 +39,14 @@ class ApplicationController < ActionController::Base
|
|||
end
|
||||
|
||||
def set_user_activity
|
||||
current_user.touch(:current_sign_in_at) if !current_user.nil? && (current_user.current_sign_in_at.nil? || current_user.current_sign_in_at < 24.hours.ago)
|
||||
return unless !current_user.nil? && (current_user.current_sign_in_at.nil? || current_user.current_sign_in_at < 24.hours.ago)
|
||||
|
||||
# Mark user as signed-in today
|
||||
current_user.update_tracked_fields(request)
|
||||
|
||||
# If the sign in is after a two week break, we need to regenerate their feed
|
||||
RegenerationWorker.perform_async(current_user.account_id) if current_user.last_sign_in_at < 14.days.ago
|
||||
return
|
||||
end
|
||||
|
||||
def check_suspension
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue