Sha256: 97845c238bd550b1ced0a7f42ed05ff91d46b7b80eea07622c56bcd595d7fbe0

Contents?: true

Size: 798 Bytes

Versions: 3

Compression:

Stored size: 798 Bytes

Contents

# frozen_string_literal: true

module GoodJob
  # Shared methods for filtering Execution/Job records from the +good_jobs+ table.
  module ErrorEvents
    extend ActiveSupport::Concern

    ERROR_EVENTS = [
      ERROR_EVENT_INTERRUPTED = 'interrupted',
      ERROR_EVENT_UNHANDLED = 'unhandled',
      ERROR_EVENT_HANDLED = 'handled',
      ERROR_EVENT_RETRIED = 'retried',
      ERROR_EVENT_RETRY_STOPPED = 'retry_stopped',
      ERROR_EVENT_DISCARDED = 'discarded',
    ].freeze

    included do
      enum error_event: {
        ERROR_EVENT_INTERRUPTED => 0,
        ERROR_EVENT_UNHANDLED => 1,
        ERROR_EVENT_HANDLED => 2,
        ERROR_EVENT_RETRIED => 3,
        ERROR_EVENT_RETRY_STOPPED => 4,
        ERROR_EVENT_DISCARDED => 5,
      }.freeze, _prefix: :error_event
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
good_job-3.16.2 app/models/concerns/good_job/error_events.rb
good_job-3.16.1 app/models/concerns/good_job/error_events.rb
good_job-3.16.0 app/models/concerns/good_job/error_events.rb