1
0
Fork 0
mirror of https://github.com/mperham/sidekiq.git synced 2022-11-09 13:52:34 -05:00

Send inline jobs through the same interface to process

This commit is contained in:
Brandon Hilkert 2015-11-13 17:50:07 -05:00
parent 785fcd503a
commit 4bac132ded

View file

@ -74,10 +74,9 @@ module Sidekiq
elsif Sidekiq::Testing.inline?
payloads.each do |job|
klass = job['class'].constantize
worker = klass.new
worker.jid = job['jid'] || SecureRandom.hex(12)
args = Sidekiq.load_json(Sidekiq.dump_json(job))["args"]
worker.perform(*args)
job['id'] ||= SecureRandom.hex(12)
job_hash = Sidekiq.load_json(Sidekiq.dump_json(job))
klass.process_job(job_hash)
end
true
else