Module: RorVsWild::Plugin::DelayedJob

Defined in:
lib/rorvswild/plugin/delayed_job.rb

Class Method Summary collapse

Class Method Details

.around_perform(job, &block) ⇒ Object


11
12
13
# File 'lib/rorvswild/plugin/delayed_job.rb', line 11

def self.around_perform(job, &block)
  RorVsWild.agent.measure_job(job.name, parameters: job.payload_object) { block.call(job) }
end

.setupObject


4
5
6
7
8
9
# File 'lib/rorvswild/plugin/delayed_job.rb', line 4

def self.setup
  return if @installed
  return unless defined?(Delayed::Worker)
  Delayed::Worker.lifecycle.around(:invoke_job, &method(:around_perform))
  @installed = true
end