diff options
author | Jeroen van Baarsen <jeroenvanbaarsen@gmail.com> | 2015-05-07 17:25:49 +0200 |
---|---|---|
committer | Jeroen van Baarsen <jeroenvanbaarsen@gmail.com> | 2015-05-07 21:59:07 +0200 |
commit | 29fcbc2ea0dc5ee2d8f512295f2ad3fac83f9941 (patch) | |
tree | be0e093df62add6a96c9860df3895b3f6fb5947f /activejob/lib | |
parent | 52d131826e46d1a4606b71ddbf57db0f75f040e0 (diff) | |
download | rails-29fcbc2ea0dc5ee2d8f512295f2ad3fac83f9941.tar.gz rails-29fcbc2ea0dc5ee2d8f512295f2ad3fac83f9941.tar.bz2 rails-29fcbc2ea0dc5ee2d8f512295f2ad3fac83f9941.zip |
Make que report back its job_id to provider_job_id
Signed-off-by: Jeroen van Baarsen <jeroenvanbaarsen@gmail.com>
Diffstat (limited to 'activejob/lib')
-rw-r--r-- | activejob/lib/active_job/queue_adapters/que_adapter.rb | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/activejob/lib/active_job/queue_adapters/que_adapter.rb b/activejob/lib/active_job/queue_adapters/que_adapter.rb index a1a41ccc32..90947aa98d 100644 --- a/activejob/lib/active_job/queue_adapters/que_adapter.rb +++ b/activejob/lib/active_job/queue_adapters/que_adapter.rb @@ -16,11 +16,15 @@ module ActiveJob # Rails.application.config.active_job.queue_adapter = :que class QueAdapter def enqueue(job) #:nodoc: - JobWrapper.enqueue job.serialize + que_job = JobWrapper.enqueue job.serialize + job.provider_job_id = que_job.attrs["job_id"] + que_job end def enqueue_at(job, timestamp) #:nodoc: - JobWrapper.enqueue job.serialize, run_at: Time.at(timestamp) + que_job = JobWrapper.enqueue job.serialize, run_at: Time.at(timestamp) + job.provider_job_id = que_job.attrs["job_id"] + que_job end class JobWrapper < Que::Job #:nodoc: |