Module: Sidekiq
- Defined in:
- lib/sidekiq/failures.rb,
lib/sidekiq/failures/version.rb,
lib/sidekiq/failures/middleware.rb,
lib/sidekiq/failures/failure_set.rb,
lib/sidekiq/failures/sorted_entry.rb,
lib/sidekiq/failures/web_extension.rb
Defined Under Namespace
Modules: Failures Classes: SortedEntry
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.
34 35 36 |
# File 'lib/sidekiq/failures.rb', line 34 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
25 26 27 28 29 30 31 |
# File 'lib/sidekiq/failures.rb', line 25 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
50 51 52 53 54 55 56 |
# File 'lib/sidekiq/failures.rb', line 50 def self.failures_max_count if !instance_variable_defined?(:@failures_max_count) || @failures_max_count.nil? 1000 else @failures_max_count end 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
45 46 47 |
# File 'lib/sidekiq/failures.rb', line 45 def self.failures_max_count=(value) @failures_max_count = value end |