Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[DRAFT] Bulk job enqueuing #56

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions app/jobs/test_run_job.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@ class TestRunJob < ApplicationJob
def perform(test_run_id)
test_run = TestRun.find(test_run_id)

test_run.test_model_version_run_ids.each do |test_model_version_run_id|
test_run.calls.times do
TestModelVersionRunJob.perform_later(test_model_version_run_id)
end
jobs = test_run.test_model_version_run_ids.flat_map do |test_model_version_run_id|
Array.new(test_run.calls) { TestModelVersionRunJob.new(test_model_version_run_id) }
end

ActiveJob.perform_all_later(jobs)
end
end
Loading