Adjustreact
daiao 5 years ago
parent 5491643af9
commit 6b2d0ffb63

@ -11,7 +11,8 @@ namespace :subjects do
str = []
puts("Parallel.worker_number: #{Parallel.worker_number}")
subjects.find_in_batches(start: (Parallel.worker_number/4) * subjects.count,
finish: ((Parallel.worker_number+1)/4) * subjects.count) do |subject|
finish: ((Parallel.worker_number+1)/4) * subjects.count) do |s|
s.each do |subject|
puts("---------------------data_statistic: #{subject.id}")
Rails.logger.info("---------------------data_statistic: #{subject.id}")
data = Subjects::DataStatisticService.new(subject)
@ -31,6 +32,7 @@ namespace :subjects do
str = []
end
end
end
end

Loading…
Cancel
Save