Class: Gush::Worker

Inherits:
ActiveJob::Base
  • Object
show all
Defined in:
lib/gush/worker.rb

Instance Method Summary collapse

Instance Method Details

#perform(workflow_id, job_id) ⇒ Object


6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
# File 'lib/gush/worker.rb', line 6

def perform(workflow_id, job_id)
  setup_job(workflow_id, job_id)

  job.payloads = incoming_payloads

  error = nil

  mark_as_started
  begin
    job.perform
  rescue StandardError => error
    mark_as_failed
    raise error
  else
    mark_as_finished
    enqueue_outgoing_jobs
  end
end