Class: CanvasSync::Jobs::SyncProvisioningReportJob
- Inherits:
-
CanvasSync::Job
- Object
- ActiveJob::Base
- CanvasSync::Job
- CanvasSync::Jobs::SyncProvisioningReportJob
- Defined in:
- lib/canvas_sync/jobs/sync_provisioning_report_job.rb
Overview
ActiveJob class that starts a Canvas provisioning report
Instance Attribute Summary
Attributes inherited from CanvasSync::Job
Instance Method Summary collapse
Methods inherited from CanvasSync::Job
#create_job_log, #report_checker_wait_time, #update_or_create_model
Instance Method Details
#perform(job_chain, options) ⇒ Object
9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 |
# File 'lib/canvas_sync/jobs/sync_provisioning_report_job.rb', line 9 def perform(job_chain, ) if [:term_scope] sub_reports = CanvasSync.fork(@job_log, job_chain, keys: [:canvas_term_id]) do |fork_template| Term.send([:term_scope]).find_each.map do |term| fork = fork_template.duplicate # Deep copy the job_chain so each report gets the correct term id passed into # its options with no side effects term_id = get_term_id(term) fork[:global_options][:canvas_term_id] = term_id { job_chain: fork.serialize, params: report_params(, term_id), options: , } end end sub_reports.each do |r| start_report(r[:params], r[:job_chain], r[:options]) end else start_report(report_params(), job_chain, ) end end |