Module: Axn::Async::Adapters::ActiveJob

Extended by:
ActiveSupport::Concern
Defined in:
lib/axn/async/adapters/active_job.rb

Constant Summary collapse

FALLBACK_MAX_RETRIES =

Fallback max retries when we can’t determine from job or backend. Matches ActiveJob’s retry_on default of 5 attempts.

5

Class Method Summary collapse

Class Method Details

._running_in_background?Boolean

Returns:

  • (Boolean)


16
17
18
# File 'lib/axn/async/adapters/active_job.rb', line 16

def _running_in_background?
  defined?(::ActiveJob) && ::ActiveJob::Base.current_job.present?
end

.backend_max_retriesObject

Attempts to determine max retries from the ActiveJob backend. Returns nil if unable to determine (caller should use fallback).



22
23
24
25
26
# File 'lib/axn/async/adapters/active_job.rb', line 22

def backend_max_retries
  return @backend_max_retries if defined?(@backend_max_retries)

  @backend_max_retries = detect_backend_max_retries
end