diff --git a/sentry-rails/lib/sentry/rails/active_job.rb b/sentry-rails/lib/sentry/rails/active_job.rb index 89f240909..dcaf89d52 100644 --- a/sentry-rails/lib/sentry/rails/active_job.rb +++ b/sentry-rails/lib/sentry/rails/active_job.rb @@ -1,6 +1,5 @@ # frozen_string_literal: true -require "sentry/rails/active_job/configuration" module Sentry module Rails module ActiveJobExtensions @@ -47,7 +46,7 @@ def record(job, &block) rescue Exception => e # rubocop:disable Lint/RescueException finish_sentry_transaction(transaction, 500) - unless Sentry.configuration.active_job.report_after_job_retries + unless Sentry.configuration.rails.active_job_report_after_job_retries capture_exception(job, e) end @@ -75,7 +74,7 @@ def register_retry_stopped_subscriber def retry_stopped_handler(*args) return if !Sentry.initialized? || already_supported_by_sentry_integration? - return unless Sentry.configuration.active_job.report_after_job_retries + return unless Sentry.configuration.rails.active_job_report_after_job_retries event = ActiveSupport::Notifications::Event.new(*args) job = event.payload[:job] error = event.payload[:error] diff --git a/sentry-rails/lib/sentry/rails/active_job/configuration.rb b/sentry-rails/lib/sentry/rails/active_job/configuration.rb deleted file mode 100644 index a1540cfac..000000000 --- a/sentry-rails/lib/sentry/rails/active_job/configuration.rb +++ /dev/null @@ -1,25 +0,0 @@ -# frozen_string_literal: true - -module Sentry - class Configuration - attr_reader :active_job - - add_post_initialization_callback do - @active_job = Sentry::Rails::ActiveJob::Configuration.new - end - end - - module Rails - module ActiveJob - class Configuration - # Set this option to true if you want Sentry to only capture the last job - # retry if it fails. - attr_accessor :report_after_job_retries - - def initialize - @report_after_job_retries = false - end - end - end - end -end diff --git a/sentry-rails/lib/sentry/rails/configuration.rb b/sentry-rails/lib/sentry/rails/configuration.rb index a28a07f69..8dfade4e6 100644 --- a/sentry-rails/lib/sentry/rails/configuration.rb +++ b/sentry-rails/lib/sentry/rails/configuration.rb @@ -156,6 +156,10 @@ class Configuration # @return [Hash>] attr_accessor :active_support_logger_subscription_items + # Set this option to true if you want Sentry to only capture the last job + # retry if it fails. + attr_accessor :active_job_report_after_job_retries + def initialize @register_error_subscriber = false @report_rescued_exceptions = true