Class: Airbrake::Sidekiq::RetryableJobsFilter
- Inherits:
-
Object
- Object
- Airbrake::Sidekiq::RetryableJobsFilter
- Defined in:
- lib/airbrake/sidekiq/retryable_jobs_filter.rb
Overview
Filter that can ignore notices from jobs that failed but will be retried by Sidekiq
Constant Summary collapse
- SIDEKIQ_GTE_5_0_0 =
Gem::Version.new(::Sidekiq::VERSION) >= Gem::Version.new('5.0.0')
- SIDEKIQ_GTE_7_0_0 =
Gem::Version.new(::Sidekiq::VERSION) >= Gem::Version.new('7.0.0')
- DEFAULT_MAX_RETRY_ATTEMPTS =
::Sidekiq::Middleware::Server::RetryJobs::DEFAULT_MAX_RETRY_ATTEMPTS
Instance Method Summary collapse
- #call(notice) ⇒ Object
-
#initialize(max_retries: nil) ⇒ RetryableJobsFilter
constructor
A new instance of RetryableJobsFilter.
Constructor Details
#initialize(max_retries: nil) ⇒ RetryableJobsFilter
Returns a new instance of RetryableJobsFilter.
21 22 23 |
# File 'lib/airbrake/sidekiq/retryable_jobs_filter.rb', line 21 def initialize(max_retries: nil) @retries_before_notify = max_retries end |
Instance Method Details
#call(notice) ⇒ Object
25 26 27 28 29 |
# File 'lib/airbrake/sidekiq/retryable_jobs_filter.rb', line 25 def call(notice) job = notice[:params][:job] notice.ignore! if retryable?(job) end |