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:
parent
785fcd503a
commit
4bac132ded
1 changed files with 3 additions and 4 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue