File: sidekiq.rb

package info (click to toggle)
ruby-exception-notification 5.0.1-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 364 kB
  • sloc: ruby: 1,350; makefile: 2
file content (14 lines) | stat: -rw-r--r-- 421 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
# frozen_string_literal: true

require "sidekiq"

::Sidekiq.configure_server do |config|
  config.error_handlers << proc do |ex, context, config|
    # Before Sidekiq 7.1.5 the config was not passed to the proc
    if config
      ExceptionNotifier.notify_exception(ex, data: {sidekiq: {context: context, config: config}})
    else
      ExceptionNotifier.notify_exception(ex, data: {sidekiq: context})
    end
  end
end