|
|
@ -9,8 +9,8 @@ namespace :subjects do
|
|
|
|
buffer_size = 0
|
|
|
|
buffer_size = 0
|
|
|
|
column_value = "subject_id, study_count, course_study_count, initiative_study, passed_count, course_used_count, " +
|
|
|
|
column_value = "subject_id, study_count, course_study_count, initiative_study, passed_count, course_used_count, " +
|
|
|
|
"school_used_count, created_at, updated_at"
|
|
|
|
"school_used_count, created_at, updated_at"
|
|
|
|
subjects.find_in_batches(batch_size: 50) do |s, index|
|
|
|
|
subjects.find_in_batches(batch_size: 50) do |s|
|
|
|
|
Parallel.each_with_index(s, in_processes: 4) do |subject|
|
|
|
|
Parallel.each_with_index(s, in_processes: 4) do |subject, index|
|
|
|
|
puts("---------------------data_statistic: #{subject.id}")
|
|
|
|
puts("---------------------data_statistic: #{subject.id}")
|
|
|
|
Rails.logger.info("---------------------data_statistic: #{subject.id}")
|
|
|
|
Rails.logger.info("---------------------data_statistic: #{subject.id}")
|
|
|
|
data = Subjects::DataStatisticService.new(subject)
|
|
|
|
data = Subjects::DataStatisticService.new(subject)
|
|
|
|