Class: RooOnRails::Sidekiq::Settings

Inherits:
Object
  • Object
show all
Defined in:
lib/roo_on_rails/sidekiq/settings.rb

Constant Summary collapse

DEFAULT_QUEUE_LATENCY_VALUES =
{
  'monitoring' => 10.seconds.to_i,
  'realtime' => 10.seconds.to_i,
  'within1minute' => 1.minute.to_i,
  'within5minutes' => 5.minutes.to_i,
  'within30minutes' => 30.minutes.to_i,
  'within1hour' => 1.hour.to_i,
  'within1day' => 1.day.to_i,
  'default' => 1.day.to_i
}.freeze

Class Method Summary collapse

Class Method Details

.concurrencyObject



22
23
24
# File 'lib/roo_on_rails/sidekiq/settings.rb', line 22

def concurrency
  ENV.fetch('SIDEKIQ_THREADS', 25)
end

.permitted_latency_valuesObject



26
27
28
# File 'lib/roo_on_rails/sidekiq/settings.rb', line 26

def permitted_latency_values
  @permitted_latency_values ||= ENV.key?('SIDEKIQ_QUEUES') ? env_queue_latency_values.freeze : DEFAULT_QUEUE_LATENCY_VALUES
end

.queuesObject



18
19
20
# File 'lib/roo_on_rails/sidekiq/settings.rb', line 18

def queues
  @queues ||= permitted_latency_values.sort_by(&:last).map(&:first).freeze
end