Module: BrainzLab::Instrumentation::DelayedJobInstrumentation

Defined in:
lib/brainzlab/instrumentation/delayed_job.rb

Defined Under Namespace

Classes: Plugin

Class Method Summary collapse

Class Method Details

.install!Object



9
10
11
12
13
14
15
16
17
18
19
20
21
# File 'lib/brainzlab/instrumentation/delayed_job.rb', line 9

def install!
  return unless defined?(::Delayed::Job) || defined?(::Delayed::Backend)
  return if @installed

  # Install lifecycle hooks
  install_lifecycle_hooks! if defined?(::Delayed::Worker)

  # Install plugin if Delayed::Plugin is available
  ::Delayed::Worker.plugins << Plugin if defined?(::Delayed::Plugin)

  @installed = true
  BrainzLab.debug_log('Delayed::Job instrumentation installed')
end

.installed?Boolean

Returns:

  • (Boolean)


23
24
25
# File 'lib/brainzlab/instrumentation/delayed_job.rb', line 23

def installed?
  @installed
end

.reset!Object



27
28
29
# File 'lib/brainzlab/instrumentation/delayed_job.rb', line 27

def reset!
  @installed = false
end