Class: Dwf::Worker

Inherits:
Object
  • Object
show all
Includes:
Sidekiq::Worker
Defined in:
lib/dwf/worker.rb

Instance Method Summary collapse

Instance Method Details

#perform(workflow_id, job_name) ⇒ Object



10
11
12
13
14
15
16
17
18
# File 'lib/dwf/worker.rb', line 10

def perform(workflow_id, job_name)
  job = client.find_job(workflow_id, job_name)
  return job.enqueue_outgoing_jobs if job.succeeded?

  job.mark_as_started
  job.perform
  job.mark_as_finished
  job.enqueue_outgoing_jobs if job.cb_build_in?
end