lib/opentelemetry/instrumentation/resque/patches/resque_job.rb in opentelemetry-instrumentation-resque-0.3.0 vs lib/opentelemetry/instrumentation/resque/patches/resque_job.rb in opentelemetry-instrumentation-resque-0.3.1
- old
+ new
@@ -8,15 +8,15 @@
module Instrumentation
module Resque
module Patches
# Module to prepend to Resque::Job for instrumentation
module ResqueJob
- def perform # rubocop:disable Metrics/AbcSize, Metrics/MethodLength, Metrics/CyclomaticComplexity, Metrics/PerceivedComplexity
+ def perform # rubocop:disable Metrics/MethodLength, Metrics/CyclomaticComplexity, Metrics/PerceivedComplexity
job_args = args || []
# Check if the job is being wrapped by ActiveJob
# before retrieving the job class name
- job_class = if payload_class_name == 'ActiveJob::QueueAdapters::ResqueAdapter::JobWrapper' && job_args[0]&.is_a?(Hash)
+ job_class = if payload_class_name == 'ActiveJob::QueueAdapters::ResqueAdapter::JobWrapper' && job_args[0].is_a?(Hash)
job_args[0]['job_class']
else
payload_class_name
end