Adjustreact
daiao 5 years ago
parent 2eb23337e7
commit 6fdc83b710

@ -22,7 +22,7 @@ class Subjects::CourseUsedInfoService < ApplicationService
# choice_shixun_frequency: 选用该课程实训的次数
course_info = []
schools.find_in_batches do |s|
Parallel.each(s) do |school|
s.each do |school|
name = school.name
course_count = school.course_count
student_count = school.courses.joins(:course_members).where(course_members: {role: 4, course_id: course_ids}).size

@ -48,7 +48,7 @@ namespace :subjects do
end
subjects.find_in_batches(batch_size: 50) do |s|
str = []
Parallel.each(s, in_threads: 4) do |subject|
Parallel.each(s, in_threads: 6) do |subject|
puts("---------------------course_info_statistic: #{subject.id}")
Rails.logger.info("---------------------course_info_statistic: #{subject.id}")
data = Subjects::CourseUsedInfoService.call(subject)

Loading…
Cancel
Save