lib/sidekiq/hierarchy/server/middleware.rb in sidekiq-hierarchy-1.1.0 vs lib/sidekiq/hierarchy/server/middleware.rb in sidekiq-hierarchy-2.0.0

- old
+ new

@@ -12,13 +12,13 @@ # Must propagate return value upwards. # Since jobs raise errors for signalling, those must be propagated as well. def call(worker, msg, queue) if msg['workflow'] == true # root job -- start of a new workflow Sidekiq::Hierarchy.current_workflow = Workflow.find_by_jid(worker.jid) - Sidekiq::Hierarchy.current_jid = worker.jid + Sidekiq::Hierarchy.current_job = Sidekiq::Hierarchy.current_workflow.root elsif msg['workflow'].is_a?(String) # child job -- inherit parent's workflow Sidekiq::Hierarchy.current_workflow = Workflow.find_by_jid(msg['workflow']) - Sidekiq::Hierarchy.current_jid = worker.jid + Sidekiq::Hierarchy.current_job = Job.find(worker.jid) end Sidekiq::Hierarchy.record_job_running ret = yield Sidekiq::Hierarchy.record_job_complete