diff options
author | Kevin Deisz <kevin.deisz@gmail.com> | 2015-05-07 18:32:15 -0400 |
---|---|---|
committer | Kevin Deisz <kevin.deisz@gmail.com> | 2015-05-07 19:17:22 -0400 |
commit | 221a411fd79a25c062100e43423188df5ac4bf2f (patch) | |
tree | 81971d73bfcd23b3d6f3041915b7fda559be3240 /activejob/lib | |
parent | 6d951bda36c60d3d377ef63b22a855fbd2735df3 (diff) | |
download | rails-221a411fd79a25c062100e43423188df5ac4bf2f.tar.gz rails-221a411fd79a25c062100e43423188df5ac4bf2f.tar.bz2 rails-221a411fd79a25c062100e43423188df5ac4bf2f.zip |
Provide provider_job_id to qu adapter.
Further work to provide provider_job_id for queue adapters.
Diffstat (limited to 'activejob/lib')
-rw-r--r-- | activejob/lib/active_job/queue_adapters/qu_adapter.rb | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/activejob/lib/active_job/queue_adapters/qu_adapter.rb b/activejob/lib/active_job/queue_adapters/qu_adapter.rb index 36f4c14911..0e198922fc 100644 --- a/activejob/lib/active_job/queue_adapters/qu_adapter.rb +++ b/activejob/lib/active_job/queue_adapters/qu_adapter.rb @@ -17,9 +17,13 @@ module ActiveJob # Rails.application.config.active_job.queue_adapter = :qu class QuAdapter def enqueue(job, *args) #:nodoc: - Qu::Payload.new(klass: JobWrapper, args: [job.serialize]).tap do |payload| + qu_job = Qu::Payload.new(klass: JobWrapper, args: [job.serialize]).tap do |payload| payload.instance_variable_set(:@queue, job.queue_name) end.push + + # qu_job can be nil depending on the configured backend + job.provider_job_id = qu_job.id unless qu_job.nil? + qu_job end def enqueue_at(job, timestamp, *args) #:nodoc: |