Sha256: 8e76c8082febfb3bd6623d6f5bdfd9b5711110e9233f83c088555b6fc08af8b1

Contents?: true

Size: 672 Bytes

Versions: 3

Compression:

Stored size: 672 Bytes

Contents

# frozen_string_literal: true

require "sidekiq"

require_relative "run_job"
require_relative "top_label"
require_relative "force_kill"

module Sidekiq
  module Belt
    module Community
      module Files
        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

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

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
sidekiq-belt-1.0.0 lib/sidekiq/belt/community/files.rb
sidekiq-belt-0.3.7 lib/sidekiq/belt/community/files.rb
sidekiq-belt-0.3.6 lib/sidekiq/belt/community/files.rb