maintenance: fix db timeouts in regenerate_post_counts!
Disable database timeouts durings daily maintenance. Fixes
`regenerate_post_counts!` timing out. Remove calls to without_timeout
because otherwise it will reenable the timeout when trying to restore
the old timeout (see 97cc873a3f).
This commit is contained in:
@@ -13,13 +13,12 @@ class SuperVoter < ApplicationRecord
|
||||
|
||||
def self.init!
|
||||
prune!
|
||||
without_timeout do
|
||||
report = PostVoteSimilarity.new(User.admins.first.id)
|
||||
|
||||
report.calculate_positive(15).each do |element|
|
||||
unless SuperVoter.where("user_id = ?", element.user_id).exists?
|
||||
SuperVoter.create(:user_id => element.user_id)
|
||||
end
|
||||
report = PostVoteSimilarity.new(User.admins.first.id)
|
||||
|
||||
report.calculate_positive(15).each do |element|
|
||||
unless SuperVoter.where("user_id = ?", element.user_id).exists?
|
||||
SuperVoter.create(:user_id => element.user_id)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user