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, SyncContentMigrationsJob, SyncContextModuleItemsJob, SyncContextModulesJob, SyncCourseProgressesJob, SyncProvisioningReportJob, SyncRubricAssessmentsJob, SyncRubricAssociationsJob, SyncRubricsJob, 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(report_name, report_params, processor, options, allow_redownloads: false) ⇒ nil
12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 |
# File 'lib/canvas_sync/jobs/report_starter.rb', line 12 def perform(report_name, report_params, processor, , allow_redownloads: false) account_id = [:account_id] || batch_context[:account_id] || "self" [:sync_start_time] = DateTime.now.utc.iso8601 [:report_params] = report_params report_id = start_report(account_id, report_name, report_params) # TODO: Restore report caching support (does nayone actually use it?) # report_id = if allow_redownloads # get_cached_report(account_id, report_name, report_params) # else # start_report(account_id, report_name, report_params) # end batch = JobBatches::Batch.new batch.description = "CanvasSync #{report_name} Fiber" batch.jobs do CanvasSync::Jobs::ReportChecker.set(wait: report_checker_wait_time).perform_later( report_name, report_id, processor.to_s, ) end end |