In the index task, mute the debug logger once per batch instead of once per iteation.

master
multiple creatures 2019-11-16 21:16:15 -06:00
parent 9ab5a3fca4
commit 00bc2e6072
1 changed files with 5 additions and 3 deletions

View File

@ -8,9 +8,11 @@ namespace :monsterfork do
Status.find_in_batches do |statuses|
ActiveRecord::Base.logger.info("Indexing status #{1+i} of #{total}.")
i += statuses.count
statuses.each do |s|
ActiveRecord::Base.logger.silence { s.update_column(:normalized_text, normalize_status(s)) }
ActiveRecord::Base.logger.silence do
i += statuses.count
statuses.each do |s|
s.update_column(:normalized_text, normalize_status(s))
end
end
end
end