Module: Exceptify::SolidQueue

Defined in:
lib/exceptify/solid_queue.rb

Constant Summary collapse

ADAPTER_NAME =
"solid_queue"
EVENT_NAME =
"perform.active_job"
JOB_ATTRIBUTES =
%i[
  job_id
  provider_job_id
  queue_name
  priority
  arguments
  executions
  exception_executions
  locale
  timezone
  enqueued_at
  scheduled_at
].freeze

Class Method Summary collapse

Class Method Details

.installObject



26
27
28
29
30
31
32
# File 'lib/exceptify/solid_queue.rb', line 26

def install
  return if installed?

  @subscription = ActiveSupport::Notifications.subscribe(EVENT_NAME) do |*args|
    notify(ActiveSupport::Notifications::Event.new(*args))
  end
end

.installed?Boolean

Returns:

  • (Boolean)


34
35
36
# File 'lib/exceptify/solid_queue.rb', line 34

def installed?
  !!@subscription
end

.notify(event) ⇒ Object



38
39
40
41
42
43
44
45
# File 'lib/exceptify/solid_queue.rb', line 38

def notify(event)
  exception = event.payload[:exception_object]
  job = event.payload[:job]

  return unless exception && solid_queue_job?(job)

  Exceptify.notify_exception(exception, data: {solid_queue: job_data(job)})
end