1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

Refactor sidekiq adapter enqueue and enqueue_at methods

This commit is contained in:
Mehmet Emin İNAÇ 2015-05-08 16:45:04 +03:00
parent 0834d60d64
commit e744cfee65

View file

@ -17,24 +17,20 @@ module ActiveJob
class SidekiqAdapter
def enqueue(job) #:nodoc:
#Sidekiq::Client does not support symbols as keys
sidekiq_job_id = Sidekiq::Client.push \
job.provider_job_id = Sidekiq::Client.push \
'class' => JobWrapper,
'wrapped' => job.class.to_s,
'queue' => job.queue_name,
'args' => [ job.serialize ]
job.provider_job_id = sidekiq_job_id
sidekiq_job_id
end
def enqueue_at(job, timestamp) #:nodoc:
sidekiq_job_id = Sidekiq::Client.push \
job.provider_job_id = Sidekiq::Client.push \
'class' => JobWrapper,
'wrapped' => job.class.to_s,
'queue' => job.queue_name,
'args' => [ job.serialize ],
'at' => timestamp
job.provider_job_id = sidekiq_job_id
sidekiq_job_id
end
class JobWrapper #:nodoc: