Class: UnitPerformerJob

Inherits:
Object
  • Object
show all
Defined in:
app/jobs/unit_performer_job.rb

Class Method Summary collapse

Class Method Details

.perform(unit_id, history_id) ⇒ Object



3
4
5
6
7
8
9
# File 'app/jobs/unit_performer_job.rb', line 3

def self.perform(unit_id, history_id)
  unit      = Apify::Scheduler::Unit.find(unit_id)
  history   = Apify::Scheduler::History.find(history_id)
  history.update(queued: true)
  response  = unit.perform
  history.update finished_at: Time.zone.now, response_body: response
end