From d368edb988dc62f6b13c0d3e370bc70008fccd78 Mon Sep 17 00:00:00 2001 From: daiao <358551898@qq.com> Date: Sun, 8 Mar 2020 11:13:49 +0800 Subject: [PATCH] =?UTF-8?q?=E8=BF=81=E7=A7=BB=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/tasks/sync_evaluate.rake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/tasks/sync_evaluate.rake b/lib/tasks/sync_evaluate.rake index 65ce0a355..67117f613 100644 --- a/lib/tasks/sync_evaluate.rake +++ b/lib/tasks/sync_evaluate.rake @@ -2,7 +2,7 @@ desc "同步学院或者单位评测数" namespace :sync_evaluate do task outpus_count: :environment do - School.find_each do |school| + School.find_in_batches(batch_size: 50) do |school| Parallel.each_with_index(school, in_processes: 5) do |s| puts "school_id:#{s.id}" evaluate_count = Game.find_by_sql("select sum(g.evaluate_count) as e_count from games g, user_extensions ue where