mirror of
https://github.com/mperham/sidekiq.git
synced 2022-11-09 13:52:34 -05:00
Support queue-names-with-dashes
This commit is contained in:
parent
6ebd1405ff
commit
2db50b479a
2 changed files with 6 additions and 1 deletions
|
@ -141,7 +141,7 @@ module Sidekiq
|
|||
|
||||
@parser = OptionParser.new do |o|
|
||||
o.on "-q", "--queue QUEUE[,WEIGHT]...", "Queues to process with optional weights" do |arg|
|
||||
queues_and_weights = arg.scan(/(\w+),?(\d*)/)
|
||||
queues_and_weights = arg.scan(/([\w-]+),?(\d*)/)
|
||||
queues_and_weights.each {|queue_and_weight| parse_queues(opts, *queue_and_weight)}
|
||||
opts[:strict] = queues_and_weights.collect(&:last).none? {|weight| weight != ''}
|
||||
end
|
||||
|
|
|
@ -65,6 +65,11 @@ class TestCli < MiniTest::Unit::TestCase
|
|||
assert_equal %w(bar foo foo foo), Sidekiq.options[:queues]
|
||||
end
|
||||
|
||||
it 'handles queues with multi-word names' do
|
||||
@cli.parse(['sidekiq', '-q', 'queue_one,queue-two', '-r', './test/fake_env.rb'])
|
||||
assert_equal %w(queue_one queue-two), Sidekiq.options[:queues]
|
||||
end
|
||||
|
||||
it 'sets verbose' do
|
||||
old = Sidekiq.logger.level
|
||||
@cli.parse(['sidekiq', '-v', '-r', './test/fake_env.rb'])
|
||||
|
|
Loading…
Add table
Reference in a new issue