Skip to content

Commit

Permalink
Refactor sidekiq adapter enqueue and enqueue_at methods
Browse files Browse the repository at this point in the history
  • Loading branch information
meinac committed May 8, 2015
1 parent 0834d60 commit e744cfe
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions activejob/lib/active_job/queue_adapters/sidekiq_adapter.rb
Expand Up @@ -17,24 +17,20 @@ module QueueAdapters
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:
Expand Down

0 comments on commit e744cfe

Please sign in to comment.