diff options
author | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2015-05-08 15:13:05 -0300 |
---|---|---|
committer | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2015-05-08 15:13:05 -0300 |
commit | fca8a7a7ba4047d3843219f9403c059f40fe0de2 (patch) | |
tree | 2c4055f11ebe7d134d04a08d3eb4a1e4ce5960dc /activejob/lib/active_job/queue_adapters | |
parent | 7b975c54d1e8c70bfeb82b15303ab18204de7b33 (diff) | |
parent | 221a411fd79a25c062100e43423188df5ac4bf2f (diff) | |
download | rails-fca8a7a7ba4047d3843219f9403c059f40fe0de2.tar.gz rails-fca8a7a7ba4047d3843219f9403c059f40fe0de2.tar.bz2 rails-fca8a7a7ba4047d3843219f9403c059f40fe0de2.zip |
Merge pull request #20064 from kddeisz/qu_provider_job_id
Provide provider_job_id to qu adapter.
Diffstat (limited to 'activejob/lib/active_job/queue_adapters')
-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: |