module ActiveJob::Instrumentation

def _perform_job

def _perform_job
  instrument(:perform_start)
  super
end

def halted_callback_hook(*)

def halted_callback_hook(*)
  super
  @_halted_callback_hook_called = true
end

def instrument(operation, payload = {}, &block) # :nodoc:

:nodoc:
def instrument(operation, payload = {}, &block) # :nodoc:
  payload[:job] = self
  payload[:adapter] = queue_adapter
  ActiveSupport::Notifications.instrument("#{operation}.active_job", payload) do |payload|
    value = block.call(payload) if block
    payload[:aborted] = @_halted_callback_hook_called if defined?(@_halted_callback_hook_called)
    @_halted_callback_hook_called = nil
    value
  end
end

def perform_now

def perform_now
  instrument(:perform) { super }
end