Sha256: 2e5692348e355cf0c13823faf43530f86ad9817b549fb50ebd8cdf1bf95af8bd

Contents?: true

Size: 419 Bytes

Versions: 28

Compression:

Stored size: 419 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

28 entries across 28 versions & 1 rubygems

Version Path
good_job-3.15.14 lib/good_job/active_job_extensions/interrupt_errors.rb
good_job-3.15.13 lib/good_job/active_job_extensions/interrupt_errors.rb
good_job-3.15.12 lib/good_job/active_job_extensions/interrupt_errors.rb
good_job-3.15.11 lib/good_job/active_job_extensions/interrupt_errors.rb
good_job-3.15.10 lib/good_job/active_job_extensions/interrupt_errors.rb
good_job-3.15.9 lib/good_job/active_job_extensions/interrupt_errors.rb
good_job-3.15.8 lib/good_job/active_job_extensions/interrupt_errors.rb
good_job-3.15.7 lib/good_job/active_job_extensions/interrupt_errors.rb
good_job-3.15.6 lib/good_job/active_job_extensions/interrupt_errors.rb
good_job-3.15.5 lib/good_job/active_job_extensions/interrupt_errors.rb
good_job-3.15.4 lib/good_job/active_job_extensions/interrupt_errors.rb
good_job-3.15.3 lib/good_job/active_job_extensions/interrupt_errors.rb
good_job-3.15.2 lib/good_job/active_job_extensions/interrupt_errors.rb
good_job-3.15.1 lib/good_job/active_job_extensions/interrupt_errors.rb
good_job-3.15.0 lib/good_job/active_job_extensions/interrupt_errors.rb
good_job-3.14.2 lib/good_job/active_job_extensions/interrupt_errors.rb
good_job-3.14.1 lib/good_job/active_job_extensions/interrupt_errors.rb
good_job-3.14.0 lib/good_job/active_job_extensions/interrupt_errors.rb
good_job-3.13.0 lib/good_job/active_job_extensions/interrupt_errors.rb
good_job-3.12.8 lib/good_job/active_job_extensions/interrupt_errors.rb