lib/ezlog/sidekiq/job_context.rb in ezlog-0.4.0 vs lib/ezlog/sidekiq/job_context.rb in ezlog-0.5.0

- old
+ new

@@ -10,11 +10,11 @@ def basic_info_from(job) { jid: job['jid'], queue: job['queue'], - worker: job['class'], + worker: job_class(job), created_at: job['created_at'], enqueued_at: job['enqueued_at'], run_count: (job['retry_count'] || -1) + 2 } end @@ -26,10 +26,14 @@ end end end def method_parameters_of(job) - Kernel.const_get(job['class'].to_sym).instance_method(:perform).parameters + Kernel.const_get(job_class(job).to_sym).instance_method(:perform).parameters + end + + def job_class(job) + job['wrapped'] || job['class'] end end end end end