Skip to content

Commit

Permalink
Cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
Tensho committed Dec 13, 2018
1 parent 4366b9e commit 3c1252f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
8 changes: 4 additions & 4 deletions lib/sidekiq/cli.rb
Expand Up @@ -251,7 +251,7 @@ def setup_options(args)

opts[:queues] = Array(opts[:queues]) << 'default' if opts[:queues].nil? || opts[:queues].empty?
opts[:strict] = true if opts[:strict].nil?
opts[:concurrency] = Integer(ENV["RAILS_MAX_THREADS"]) if !opts[:concurrency] && ENV["RAILS_MAX_THREADS"]
opts[:concurrency] = Integer(ENV["RAILS_MAX_THREADS"]) if opts[:concurrency].nil? && ENV["RAILS_MAX_THREADS"]

# merge with defaults
options.merge!(opts)
Expand Down Expand Up @@ -429,10 +429,10 @@ def parse_queues(opts, queues_and_weights)
queues_and_weights.each { |queue_and_weight| parse_queue(opts, *queue_and_weight) }
end

def parse_queue(opts, q, weight=nil)
def parse_queue(opts, queue, weight = nil)
opts[:queues] ||= []
raise ArgumentError, "queues: #{q} cannot be defined twice" if opts[:queues].include?(q)
[weight.to_i, 1].max.times { opts[:queues] << q }
raise ArgumentError, "queues: #{queue} cannot be defined twice" if opts[:queues].include?(queue)
[weight.to_i, 1].max.times { opts[:queues] << queue }
opts[:strict] = false if weight.to_i > 0
end
end
Expand Down
1 change: 0 additions & 1 deletion test/test_cli.rb
Expand Up @@ -247,7 +247,6 @@ class TestCLI < Minitest::Test

describe 'default config file' do
describe 'when required path is a directory' do
focus
it 'tries config/sidekiq.yml' do
@cli.parse(%w[sidekiq -r ./test/dummy])

Expand Down

0 comments on commit 3c1252f

Please sign in to comment.