Module: AcidicJob::PerformWrapper

Defined in:
lib/acidic_job/perform_wrapper.rb

Overview

NOTE: it is essential that this be a bare module and not an ActiveSupport::Concern WHY?

Instance Method Summary collapse

Instance Method Details

#perform(*args) ⇒ Object



7
8
9
10
11
12
13
14
15
16
17
18
19
20
# File 'lib/acidic_job/perform_wrapper.rb', line 7

def perform(*args)
  @arguments = args

  # we don't want to run the `perform` callbacks twice, since ActiveJob already handles that for us
  if defined?(ActiveJob) && self.class < ActiveJob::Base
    super(*args)
  elsif defined?(Sidekiq) && self.class.include?(Sidekiq::Worker)
    run_callbacks :perform do
      super(*args)
    end
  else
    raise UnknownJobAdapter
  end
end