|
|
|
@ -8,9 +8,11 @@ namespace :subjects do
|
|
|
|
|
column_value = "subject_id, study_count, course_study_count, initiative_study, passed_count, course_used_count, " +
|
|
|
|
|
"school_used_count, created_at, updated_at"
|
|
|
|
|
subjects.find_in_batches(batch_size: 50) do |s|
|
|
|
|
|
str = ""
|
|
|
|
|
buffer_size = 0
|
|
|
|
|
Parallel.each_with_index(s, in_processes: 4) do |subject, index|
|
|
|
|
|
if subject == s.first
|
|
|
|
|
buffer_size == 0
|
|
|
|
|
str == ""
|
|
|
|
|
end
|
|
|
|
|
buffer_size += 1
|
|
|
|
|
str += ", " unless str.empty?
|
|
|
|
|
puts("---------------------data_statistic: #{subject.id}")
|
|
|
|
|