Sha256: 873912f08fafd7364f047fb39bca673755dd5e49889ddc3a8a1bad505a3051d0
Contents?: true
Size: 805 Bytes
Versions: 75
Compression:
Stored size: 805 Bytes
Contents
# frozen_string_literal: true module GoodJob # :nodoc: # Extends GoodJob module to track Rails boot dependencies. module Dependencies extend ActiveSupport::Concern included do mattr_accessor :_framework_ready, default: false end class_methods do # Whether Rails framework has sufficiently initialized to enable Async execution. def async_ready? Rails.application.initialized? || _framework_ready end def _start_async_adapters return unless async_ready? ActiveJob::Base.queue_adapter # Ensure Active Job is initialized GoodJob::Adapter.instances .select(&:execute_async?) .reject(&:async_started?) .each(&:start_async) end end end end
Version data entries
75 entries across 75 versions & 1 rubygems