diff options
Diffstat (limited to 'lib/active_job/queue_adapters/sidekiq_adapter.rb')
-rw-r--r-- | lib/active_job/queue_adapters/sidekiq_adapter.rb | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/lib/active_job/queue_adapters/sidekiq_adapter.rb b/lib/active_job/queue_adapters/sidekiq_adapter.rb index c8fac32963..087e833d24 100644 --- a/lib/active_job/queue_adapters/sidekiq_adapter.rb +++ b/lib/active_job/queue_adapters/sidekiq_adapter.rb @@ -5,7 +5,8 @@ module ActiveJob class SidekiqAdapter class << self def queue(job, *args) - JobWrapper.client_push class: JobWrapper, queue: job.queue_name, args: [ job, *args ] + item = { 'class' => JobWrapper, 'queue' => job.queue_name, 'args' => [job, *args] } + Sidekiq::Client.push(job.get_sidekiq_options.merge(item)) end end @@ -13,9 +14,15 @@ module ActiveJob include Sidekiq::Worker def perform(job_name, *args) - job_name.constantize.new.perform *Parameters.deserialize(args) + instance = job_name.constantize.new + instance.jid = self.jid + instance.perform *Parameters.deserialize(args) end end end end end + +class ActiveJob::Base + include Sidekiq::Worker +end |