diff options
author | Mike Perham <mperham@gmail.com> | 2015-03-23 15:16:07 -0700 |
---|---|---|
committer | Mike Perham <mperham@gmail.com> | 2015-03-23 15:16:07 -0700 |
commit | 8d2b1406bc201d8705e931b6f043441930f2e8ac (patch) | |
tree | cbe7265263418ba20eb3cb2a3d7794b62640d493 /activejob/lib/active_job/queue_adapters | |
parent | 4a0f314d8a54c090e53400f84508a3118c0fe2b4 (diff) | |
download | rails-8d2b1406bc201d8705e931b6f043441930f2e8ac.tar.gz rails-8d2b1406bc201d8705e931b6f043441930f2e8ac.tar.bz2 rails-8d2b1406bc201d8705e931b6f043441930f2e8ac.zip |
Pass wrapped class name to Sidekiq for logging purposes
Sidekiq logs the name of the job class being performed. Because
ActiveJob wraps the class, this means every job logs as an AJ::JobWrapper
instead of the actual class name.
Will help fix mperham/sidekiq#2248
Diffstat (limited to 'activejob/lib/active_job/queue_adapters')
-rw-r--r-- | activejob/lib/active_job/queue_adapters/sidekiq_adapter.rb | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/activejob/lib/active_job/queue_adapters/sidekiq_adapter.rb b/activejob/lib/active_job/queue_adapters/sidekiq_adapter.rb index e02593ec9c..743d5ea333 100644 --- a/activejob/lib/active_job/queue_adapters/sidekiq_adapter.rb +++ b/activejob/lib/active_job/queue_adapters/sidekiq_adapter.rb @@ -18,17 +18,19 @@ module ActiveJob def enqueue(job) #:nodoc: #Sidekiq::Client does not support symbols as keys Sidekiq::Client.push \ - 'class' => JobWrapper, - 'queue' => job.queue_name, - 'args' => [ job.serialize ] + 'class' => JobWrapper, + 'wrapped' => job.class.to_s, + 'queue' => job.queue_name, + 'args' => [ job.serialize ] end def enqueue_at(job, timestamp) #:nodoc: Sidekiq::Client.push \ - 'class' => JobWrapper, - 'queue' => job.queue_name, - 'args' => [ job.serialize ], - 'at' => timestamp + 'class' => JobWrapper, + 'wrapped' => job.class.to_s, + 'queue' => job.queue_name, + 'args' => [ job.serialize ], + 'at' => timestamp end class JobWrapper #:nodoc: |