From edebe313bfdb4b4d65f5b2a6b61ec9361dcdf290 Mon Sep 17 00:00:00 2001 From: daiao <358551898@qq.com> Date: Thu, 13 Feb 2020 20:09:47 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AE=9E=E8=B7=B5=E8=AF=BE=E7=A8=8B=E5=AD=A6?= =?UTF-8?q?=E4=B9=A0=E7=BB=9F=E8=AE=A1=E5=A4=9A=E8=BF=9B=E7=A8=8B=E7=BB=9F?= =?UTF-8?q?=E8=AE=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/tasks/statistic_subject_info.rake | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/tasks/statistic_subject_info.rake b/lib/tasks/statistic_subject_info.rake index e4cc3b380..71fb8ed36 100644 --- a/lib/tasks/statistic_subject_info.rake +++ b/lib/tasks/statistic_subject_info.rake @@ -46,7 +46,7 @@ namespace :subjects do if ENV['subject_id'].present? subjects = subjects.where(id:ENV['subject_id']) end - subjects.find_in_batches(batch_size: 50) do |s| + subjects.find_in_batches(batch_size: 20) do |s| str = [] Parallel.each(s, in_processes: 6) do |subject| puts("---------------------course_info_statistic: #{subject.id}") @@ -85,7 +85,7 @@ namespace :subjects do end column_value = "subject_id, shixun_id, stage, shixun_name, challenge_count, course_count, " + "school_count, used_count, passed_count, evaluate_count, passed_ave_time, created_at, updated_at" - subjects.find_in_batches(batch_size: 50) do |s| + subjects.find_in_batches(batch_size: 20) do |s| Parallel.each_with_index(s, in_processes: 4) do |subject, index, str = []| puts("---------------------shixun_info_statistic: #{subject.id}") Rails.logger.info("---------------------shixun_info_statistic: #{subject.id}")