Class: CanvasSync::Jobs::ReportStarter
- Inherits:
-
CanvasSync::Job
- Object
- ActiveJob::Base
- CanvasSync::Job
- CanvasSync::Jobs::ReportStarter
- Defined in:
- lib/canvas_sync/jobs/report_starter.rb
Overview
Starts a Canvas report and enqueues a ReportChecker
Direct Known Subclasses
SyncAccountsJob, SyncAssignmentGroupsJob, SyncAssignmentsJob, SyncContextModuleItemsJob, SyncContextModulesJob, SyncSimpleTableJob, SyncSubmissionsJob
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, report_name, report_params, processor, options, allow_redownloads: false) ⇒ nil
13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 |
# File 'lib/canvas_sync/jobs/report_starter.rb', line 13 def perform(job_chain, report_name, report_params, processor, , allow_redownloads: false) account_id = [:account_id] || job_chain[:global_options][:account_id] || "self" [:sync_start_time] = DateTime.now.utc.iso8601 report_id = if allow_redownloads get_cached_report(job_chain, account_id, report_name, report_params) else start_report(job_chain, account_id, report_name, report_params) end CanvasSync::Jobs::ReportChecker.set(wait: report_checker_wait_time).perform_later( job_chain, report_name, report_id, processor, , ) end |