Module: Sidekiq
- Defined in:
- lib/sidekiq/failures.rb,
lib/sidekiq/failures/version.rb,
lib/sidekiq/failures/middleware.rb,
lib/sidekiq/failures/web_extension.rb
Defined Under Namespace
Modules: Failures
Constant Summary collapse
- SIDEKIQ_FAILURES_MODES =
[:all, :exhausted, :off].freeze
Class Method Summary collapse
-
.failures_default_mode ⇒ Object
Fetches the default failure tracking mode.
-
.failures_default_mode=(mode) ⇒ Object
Sets the default failure tracking mode.
-
.failures_max_count ⇒ Object
Fetches the failures max count value.
-
.failures_max_count=(value) ⇒ Object
Sets the maximum number of failures to track.
Class Method Details
.failures_default_mode ⇒ Object
Fetches the default failure tracking mode.
30 31 32 |
# File 'lib/sidekiq/failures.rb', line 30 def self.failures_default_mode @failures_default_mode || :all end |
.failures_default_mode=(mode) ⇒ Object
Sets the default failure tracking mode.
The value provided here will be the default behavior but can be overwritten per worker by using ‘sidekiq_options :failures => :mode`
Defaults to :all
21 22 23 24 25 26 27 |
# File 'lib/sidekiq/failures.rb', line 21 def self.failures_default_mode=(mode) unless SIDEKIQ_FAILURES_MODES.include?(mode.to_sym) raise ArgumentError, "Sidekiq#failures_default_mode valid options: #{SIDEKIQ_FAILURES_MODES}" end @failures_default_mode = mode.to_sym end |
.failures_max_count ⇒ Object
Fetches the failures max count value
46 47 48 49 50 |
# File 'lib/sidekiq/failures.rb', line 46 def self.failures_max_count return 1000 if @failures_max_count.nil? @failures_max_count end |
.failures_max_count=(value) ⇒ Object
Sets the maximum number of failures to track
If the number of failures exceeds this number the list will be trimmed (oldest failures will be purged).
Defaults to 1000 Set to false to disable rotation
41 42 43 |
# File 'lib/sidekiq/failures.rb', line 41 def self.failures_max_count=(value) @failures_max_count = value end |