Class: CanvasSync::Jobs::ReportProcessorJob

Inherits:
CanvasSync::Job
  • Object
show all
Defined in:
lib/canvas_sync/jobs/report_processor_job.rb

Overview

ActiveJob class that wraps around a report processor. This job will download the report, and then pass the file path and options into the process method on the processor.

Instance Method Summary collapse

Methods inherited from CanvasSync::Job

#create_job_log, #report_checker_wait_time

Instance Method Details

#perform(job_chain, report_name, report_url, processor, options) ⇒ nil



15
16
17
18
19
20
21
22
23
# File 'lib/canvas_sync/jobs/report_processor_job.rb', line 15

def perform(job_chain, report_name, report_url, processor, options)
  @job_log.update_attributes(job_class: processor)
  download(report_name, report_url) do |file_path|
    options = job_chain[:global_options].merge(options)
    processor.constantize.process(file_path, options)
  end

  CanvasSync.invoke_next(job_chain)
end