Adjustreact
daiao 5 years ago
parent 8655498b9c
commit cf6981c875

@ -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}")

Loading…
Cancel
Save