Class: CanvasSync::Job

Inherits:
ActiveJob::Base
  • Object
show all
Defined in:
lib/canvas_sync/job.rb

Overview

Inherit from this class to build a Job that will log to the canvas_sync_job_logs table

Instance Method Summary collapse

Instance Method Details

#create_job_log(job) ⇒ Object



38
39
40
41
42
43
44
45
# File 'lib/canvas_sync/job.rb', line 38

def create_job_log(job)
  CanvasSync::JobLog.create(
    job_class: self.class.name,
    job_arguments: job.arguments,
    job_id: job.job_id,
    status: JobLog::ENQUEUED_STATUS,
  )
end

#report_checker_wait_timeObject



34
35
36
# File 'lib/canvas_sync/job.rb', line 34

def report_checker_wait_time
  Rails.env.development? ? 1.second : 30.seconds
end