lib/appsignal/integrations/delayed_job_plugin.rb in appsignal-2.1.0.alpha.3 vs lib/appsignal/integrations/delayed_job_plugin.rb in appsignal-2.1.0.beta.1
- old
+ new
@@ -6,30 +6,30 @@
callbacks do |lifecycle|
lifecycle.around(:invoke_job) do |job, &block|
invoke_with_instrumentation(job, block)
end
- lifecycle.after(:execute) do |execute|
- Appsignal.stop('delayed job')
+ lifecycle.after(:execute) do |_execute|
+ Appsignal.stop("delayed job")
end
end
def self.invoke_with_instrumentation(job, block)
if job.respond_to?(:payload_object)
# Direct Delayed Job
class_and_method_name = extract_value(job.payload_object, :appsignal_name, job.name)
- class_name, method_name = class_and_method_name.split('#')
+ class_name, method_name = class_and_method_name.split("#")
args = extract_value(job.payload_object, :args, {})
job_data = job
elsif job.respond_to?(:job_data)
# Via ActiveJob
- class_name, method_name = job.job_data[:name].split('#')
+ class_name, method_name = job.job_data[:name].split("#")
args = job.job_data[:args] || {}
job_data = job.job_data
end
Appsignal.monitor_transaction(
- 'perform_job.delayed_job',
+ "perform_job.delayed_job",
:class => class_name,
:method => method_name,
:metadata => {
:id => extract_value(job_data, :id, nil, true),
:queue => extract_value(job_data, :queue),