diff options
author | multiple creatures <dev@multiple-creature.party> | 2019-11-16 21:16:15 -0600 |
---|---|---|
committer | multiple creatures <dev@multiple-creature.party> | 2019-11-16 21:16:15 -0600 |
commit | 00bc2e6072a6fb55eace71eed90fa2d94a68bc2c (patch) | |
tree | a374c6b3209024176eb28a90923cb0597a07485e /lib | |
parent | 9ab5a3fca492f7d28b66ef90ccc7880893ac4063 (diff) |
In the index task, mute the debug logger once per batch instead of once per iteation.
Diffstat (limited to 'lib')
-rw-r--r-- | lib/tasks/monsterfork.rake | 8 |
1 files changed, 5 insertions, 3 deletions
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 |