Skip to content

Commit

Permalink
Merge branch 'reindex-user-content' into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
gbp committed Nov 12, 2021
2 parents ab0080e + 2776b0d commit f2e5123
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions app/models/user.rb
Original file line number Diff line number Diff line change
Expand Up @@ -320,17 +320,21 @@ def reindex_referencing_models
return if no_xapian_reindex == true
return unless saved_change_to_attribute?(:url_name)

expire_comments
expire_requests
end

def expire_requests
info_requests.find_each(&:expire)
end

def expire_comments
comments.find_each do |comment|
# TODO: Extract to Comment#expire
comment.info_request_events.find_each do |info_request_event|
info_request_event.xapian_mark_needs_index
end
end

info_requests.find_each do |info_request|
info_request.info_request_events.find_each do |info_request_event|
info_request_event.xapian_mark_needs_index
end
end
end

def locale
Expand Down Expand Up @@ -453,10 +457,6 @@ def exceeded_limit?
recent_requests >= AlaveteliConfiguration.max_requests_per_user_per_day
end

def expire_requests
info_requests.find_each(&:expire)
end

def next_request_permitted_at
return nil if no_limit

Expand Down

0 comments on commit f2e5123

Please sign in to comment.