Module: Sidekiq::Belt::Community::Files

Defined in:
lib/sidekiq/belt/community/files.rb

Class Method Summary collapse

Class Method Details

.should_use?(key, options) ⇒ Boolean

Returns:

  • (Boolean)


21
22
23
# File 'lib/sidekiq/belt/community/files.rb', line 21

def self.should_use?(key, options)
  options.include?(:all) || options.include?(key)
end

.use!(options = [:all]) ⇒ Object



13
14
15
16
17
18
19
# File 'lib/sidekiq/belt/community/files.rb', line 13

def self.use!(options = [:all])
  Sidekiq::Belt::Community::RunJob.use! if should_use?(:run_job, options)
  Sidekiq::Belt::Community::TopLabel.use! if should_use?(:top_label, options)
  Sidekiq::Belt::Community::ForceKill.use! if should_use?(:force_kill, options)

  true
end