Sha256: f33bb489541869f473ca02bff58474e86f6014d364f650fceff019aa3da3b58b

Contents?: true

Size: 573 Bytes

Versions: 7

Compression:

Stored size: 573 Bytes

Contents

# frozen_string_literal: true

module Delayed
  module JobGroups
    module JobExtensions
      extend ActiveSupport::Concern
      module ReadyToRunExtension
        def ready_to_run(worker_name, max_run_time)
          super(worker_name, max_run_time).where(blocked: false)
        end
      end

      included do
        belongs_to :job_group, class_name: 'Delayed::JobGroups::JobGroup', required: false

        class << self
          prepend ReadyToRunExtension
        end
      end
      def in_job_group?
        job_group_id.present?
      end
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
delayed_job_groups_plugin-0.12.0 lib/delayed/job_groups/job_extensions.rb
delayed_job_groups_plugin-0.11.0 lib/delayed/job_groups/job_extensions.rb
delayed_job_groups_plugin-0.10.1 lib/delayed/job_groups/job_extensions.rb
delayed_job_groups_plugin-0.10.0 lib/delayed/job_groups/job_extensions.rb
delayed_job_groups_plugin-0.9.0 lib/delayed/job_groups/job_extensions.rb
delayed_job_groups_plugin-0.8.0 lib/delayed/job_groups/job_extensions.rb
delayed_job_groups_plugin-0.7.0 lib/delayed/job_groups/job_extensions.rb