diff options
Diffstat (limited to 'activejob/lib')
-rw-r--r-- | activejob/lib/active_job/queue_adapters/delayed_job_adapter.rb | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/activejob/lib/active_job/queue_adapters/delayed_job_adapter.rb b/activejob/lib/active_job/queue_adapters/delayed_job_adapter.rb index 370a1fc01f..4d27c4fff8 100644 --- a/activejob/lib/active_job/queue_adapters/delayed_job_adapter.rb +++ b/activejob/lib/active_job/queue_adapters/delayed_job_adapter.rb @@ -15,16 +15,22 @@ module ActiveJob class DelayedJobAdapter class << self def enqueue(job) #:nodoc: - JobWrapper.new.delay(queue: job.queue_name).perform(job.serialize) + Delayed::Job.enqueue(JobWrapper.new(job.serialize), queue: job.queue_name) end def enqueue_at(job, timestamp) #:nodoc: - JobWrapper.new.delay(queue: job.queue_name, run_at: Time.at(timestamp)).perform(job.serialize) + Delayed::Job.enqueue(JobWrapper.new(job.serialize), queue: job.queue_name, run_at: Time.at(timestamp)) end end class JobWrapper #:nodoc: - def perform(job_data) + attr_accessor :job_data + + def initialize(job_data) + @job_data = job_data + end + + def perform Base.execute(job_data) end end |