lib/sidekiq/testing.rb in sidekiq-7.3.2 vs lib/sidekiq/testing.rb in sidekiq-7.3.3

- old
+ new

@@ -281,14 +281,14 @@ Queues.delete_for(next_job["jid"], next_job["queue"], to_s) process_job(next_job) end def process_job(job) - inst = new - inst.jid = job["jid"] - inst.bid = job["bid"] if inst.respond_to?(:bid=) - Sidekiq::Testing.server_middleware.invoke(inst, job, job["queue"]) do - execute_job(inst, job["args"]) + instance = new + instance.jid = job["jid"] + instance.bid = job["bid"] if instance.respond_to?(:bid=) + Sidekiq::Testing.server_middleware.invoke(instance, job, job["queue"]) do + execute_job(instance, job["args"]) end end def execute_job(worker, args) worker.perform(*args)