From 00bc2e6072a6fb55eace71eed90fa2d94a68bc2c Mon Sep 17 00:00:00 2001 From: multiple creatures Date: Sat, 16 Nov 2019 21:16:15 -0600 Subject: In the index task, mute the debug logger once per batch instead of once per iteation. --- lib/tasks/monsterfork.rake | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'lib') diff --git a/lib/tasks/monsterfork.rake b/lib/tasks/monsterfork.rake index f92eb752d..f36cc3915 100644 --- a/lib/tasks/monsterfork.rake +++ b/lib/tasks/monsterfork.rake @@ -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 -- cgit