Sha256: 3548c8277c3feff44f7dd1c414b2a8f94a6ef641ead931b9a32ca70a1f7737bf

Contents?: true

Size: 420 Bytes

Versions: 65

Compression:

Stored size: 420 Bytes

Contents

# frozen_string_literal: true

module GoodJob
  module ActiveJobExtensions
    module InterruptErrors
      extend ActiveSupport::Concern

      included do
        around_perform do |_job, block|
          raise InterruptError, "Interrupted after starting perform at '#{CurrentThread.execution_interrupted}'" if CurrentThread.execution_interrupted.present?

          block.call
        end
      end
    end
  end
end

Version data entries

65 entries across 65 versions & 1 rubygems

Version Path
good_job-3.21.4 lib/good_job/active_job_extensions/interrupt_errors.rb
good_job-3.21.3 lib/good_job/active_job_extensions/interrupt_errors.rb
good_job-3.21.2 lib/good_job/active_job_extensions/interrupt_errors.rb
good_job-3.21.1 lib/good_job/active_job_extensions/interrupt_errors.rb
good_job-3.21.0 lib/good_job/active_job_extensions/interrupt_errors.rb
good_job-3.20.0 lib/good_job/active_job_extensions/interrupt_errors.rb
good_job-3.19.4 lib/good_job/active_job_extensions/interrupt_errors.rb
good_job-3.19.3 lib/good_job/active_job_extensions/interrupt_errors.rb
good_job-3.19.2 lib/good_job/active_job_extensions/interrupt_errors.rb
good_job-3.19.1 lib/good_job/active_job_extensions/interrupt_errors.rb
good_job-3.19.0 lib/good_job/active_job_extensions/interrupt_errors.rb
good_job-3.18.3 lib/good_job/active_job_extensions/interrupt_errors.rb
good_job-3.18.2 lib/good_job/active_job_extensions/interrupt_errors.rb
good_job-3.18.1 lib/good_job/active_job_extensions/interrupt_errors.rb
good_job-3.18.0 lib/good_job/active_job_extensions/interrupt_errors.rb
good_job-3.17.4 lib/good_job/active_job_extensions/interrupt_errors.rb
good_job-3.17.3 lib/good_job/active_job_extensions/interrupt_errors.rb
good_job-3.17.2 lib/good_job/active_job_extensions/interrupt_errors.rb
good_job-3.17.1 lib/good_job/active_job_extensions/interrupt_errors.rb
good_job-3.17.0 lib/good_job/active_job_extensions/interrupt_errors.rb