diff --git a/activejob/CHANGELOG.md b/activejob/CHANGELOG.md index 53f940ebcc..ca5cba9ee6 100644 --- a/activejob/CHANGELOG.md +++ b/activejob/CHANGELOG.md @@ -1,3 +1,7 @@ +* Add support for Sidekiq's transaction-aware client + + *Jonathan del Strother* + * Remove QueAdapter from Active Job. After maintaining Active Job QueAdapter by Rails and Que side diff --git a/activejob/lib/active_job/queue_adapters/sidekiq_adapter.rb b/activejob/lib/active_job/queue_adapters/sidekiq_adapter.rb index 2e3a4b527a..1bd507552b 100644 --- a/activejob/lib/active_job/queue_adapters/sidekiq_adapter.rb +++ b/activejob/lib/active_job/queue_adapters/sidekiq_adapter.rb @@ -18,21 +18,17 @@ module ActiveJob # Rails.application.config.active_job.queue_adapter = :sidekiq class SidekiqAdapter def enqueue(job) # :nodoc: - # Sidekiq::Client does not support symbols as keys - job.provider_job_id = Sidekiq::Client.push \ - "class" => JobWrapper, - "wrapped" => job.class, - "queue" => job.queue_name, - "args" => [ job.serialize ] + job.provider_job_id = JobWrapper.set( + wrapped: job.class, + queue: job.queue_name + ).perform_async(job.serialize) end def enqueue_at(job, timestamp) # :nodoc: - job.provider_job_id = Sidekiq::Client.push \ - "class" => JobWrapper, - "wrapped" => job.class, - "queue" => job.queue_name, - "args" => [ job.serialize ], - "at" => timestamp + job.provider_job_id = JobWrapper.set( + wrapped: job.class, + queue: job.queue_name, + ).perform_at(timestamp, job.serialize) end class JobWrapper # :nodoc: