Module: FiberAudit::Runtime::RailsIntegration::JobHook

Defined in:
lib/fiber_audit/runtime/rails_integration.rb

Instance Method Summary collapse

Instance Method Details

#perform_nowObject



249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
# File 'lib/fiber_audit/runtime/rails_integration.rb', line 249

def perform_now(...)
  integration = RailsIntegration.current
  return super unless integration&.active_for_current_process?

  executed = false
  begin
    integration.context_store.with(:job) do
      executed = true
      super
    end
  rescue StandardError
    raise if executed
    # Context setup failed before application code ran
    raise unless integration.send(:fail_open?)

    integration.send(:account_internal_error)
    super
  end
end