dev_course
cxt 5 years ago
parent ac4069333d
commit 2b745db4b4

@ -16,7 +16,8 @@ class HomeworkEndUpdateScoreJob < ApplicationJob
student_works = homework.student_works.where(user_id: user_ids) student_works = homework.student_works.where(user_id: user_ids)
end end
myshixuns = Myshixun.where(shixun_id: params[:shixun_id], user_id: user_ids). shixun_id = homework.homework_commons_shixun.try(:shixun_id)
myshixuns = Myshixun.where(shixun_id: shixun_id, user_id: user_ids).
includes(:games).where(games: {challenge_id: homework.homework_challenge_settings.pluck(:challenge_id)}) includes(:games).where(games: {challenge_id: homework.homework_challenge_settings.pluck(:challenge_id)})
challenge_settings = homework.homework_challenge_settings challenge_settings = homework.homework_challenge_settings
myshixuns.find_each(batch_size: 100) do |myshixun| myshixuns.find_each(batch_size: 100) do |myshixun|

@ -31,7 +31,7 @@ class PollPublishNotifyJob < ApplicationJob
Tiding.bulk_insert(*attrs) do |worker| Tiding.bulk_insert(*attrs) do |worker|
teacher_ids = teachers.pluck(:user_id) teacher_ids = teachers.pluck(:user_id)
unless poll.tidings.exists?(parent_container_type: 'PollPublish', user_id: teacher_ids) unless poll.tidings.exists?(parent_container_type: 'PollPublish', user_id: teacher_ids)
teacher_ids.find_each do |user_id| teacher_ids.each do |user_id|
worker.add same_attrs.merge(user_id: user_id) worker.add same_attrs.merge(user_id: user_id)
end end
end end

Loading…
Cancel
Save