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:
parent
0834d60d64
commit
e744cfee65
1 changed files with 2 additions and 6 deletions
|
@ -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:
|
||||
|
|
Loading…
Reference in a new issue