Class: Dynflow::Executors::Sidekiq::WorkerJobs::PerformWork

Inherits:
InternalJobBase
  • Object
show all
Defined in:
lib/dynflow/executors/sidekiq/worker_jobs.rb

Instance Method Summary collapse

Methods inherited from InternalJobBase

inherited, #telemetry_options, #worker_id

Methods included from Serialization::WorkerExtension::ClassMethods

#client_push

Instance Method Details

#perform(work_item) ⇒ Object



8
9
10
11
12
13
14
15
16
17
18
19
20
# File 'lib/dynflow/executors/sidekiq/worker_jobs.rb', line 8

def perform(work_item)
  with_telemetry(work_item) do
    Executors.run_user_code do
      work_item.world = Dynflow.process_world
      work_item.execute
    end
  end
rescue Errors::PersistenceError => e
  OrchestratorJobs::HandlePersistenceError.perform_async(e, work_item)
ensure
  step = work_item.step if work_item.is_a?(Director::StepWorkItem)
  OrchestratorJobs::WorkerDone.perform_async(work_item, step && step.delayed_events)
end