Class: Joblin::BackgroundTask::Executor::ExecutorJob
- Inherits:
-
ActiveJob::Base
- Object
- ActiveJob::Base
- Joblin::BackgroundTask::Executor::ExecutorJob
- Defined in:
- app/models/joblin/background_task/executor.rb
Instance Method Summary collapse
Instance Method Details
#perform ⇒ Object
78 79 80 81 82 83 84 85 |
# File 'app/models/joblin/background_task/executor.rb', line 78 def perform the_task.update(workflow_state: "started") if the_task.workflow_state == "scheduled" the_task.perform rescue InvalidJobError => ex the_task. ||= ex. the_task.workflow_state = "failed" the_task.save! if the_task.changed? end |
#the_task ⇒ Object
87 88 89 90 91 |
# File 'app/models/joblin/background_task/executor.rb', line 87 def the_task @the_task ||= BackgroundTask.find(batch_context[:background_task_id]).tap do |task| task.instance_variable_set(:@executor, self) end end |