diff --git a/app/models/attempt.rb b/app/models/attempt.rb index 3d9fc4f4..ab3099a9 100644 --- a/app/models/attempt.rb +++ b/app/models/attempt.rb @@ -69,6 +69,7 @@ class Attempt < ApplicationRecord private def update_school_categories + return if ENV['BULK_PROCESS'] school_category = SchoolCategory.for(recipient.school, question.category).first if school_category.nil? school_category = SchoolCategory.create(school: recipient.school, category: question.category) diff --git a/lib/tasks/data.rake b/lib/tasks/data.rake index 849ef9fa..63a3aff0 100644 --- a/lib/tasks/data.rake +++ b/lib/tasks/data.rake @@ -145,7 +145,7 @@ namespace :data do bad_answers = {} year = '2017' - timeToRun = 6 * 60 * 60 + timeToRun = 100 * 60 * 60 startIndex = 0 startTime = Time.new @@ -165,7 +165,7 @@ namespace :data do break end - if index % 10 == 0 + if index % 100 == 0 puts("DATAMSG: PROCESSING ROW: #{index} OUT OF #{csv.length} ROWS: #{Time.new - t} - Total: #{Time.new - startTime} - #{timeToRun - (Time.new - startTime)} TO GO") t = Time.new end