mirror of
https://github.com/mperham/sidekiq.git
synced 2022-11-09 13:52:34 -05:00
Accept stringy values for -i (like -i worker.1)
This commit is contained in:
parent
3eb6ad457c
commit
3e0a5ea8d7
2 changed files with 6 additions and 1 deletions
|
@ -248,7 +248,7 @@ module Sidekiq
|
||||||
end
|
end
|
||||||
|
|
||||||
o.on '-i', '--index INT', "unique process index on this machine" do |arg|
|
o.on '-i', '--index INT', "unique process index on this machine" do |arg|
|
||||||
opts[:index] = Integer(arg)
|
opts[:index] = Integer(arg.match(/\d+/)[0])
|
||||||
end
|
end
|
||||||
|
|
||||||
o.on '-p', '--profile', "Profile all code run by Sidekiq" do |arg|
|
o.on '-p', '--profile', "Profile all code run by Sidekiq" do |arg|
|
||||||
|
|
|
@ -45,6 +45,11 @@ class TestCli < MiniTest::Unit::TestCase
|
||||||
assert_equal 7, Sidekiq.options[:index]
|
assert_equal 7, Sidekiq.options[:index]
|
||||||
end
|
end
|
||||||
|
|
||||||
|
it 'accepts a stringy process index' do
|
||||||
|
@cli.parse(['sidekiq', '-i', 'worker.7', '-r', './test/fake_env.rb'])
|
||||||
|
assert_equal 7, Sidekiq.options[:index]
|
||||||
|
end
|
||||||
|
|
||||||
it 'sets strictly ordered queues if weights are not present' do
|
it 'sets strictly ordered queues if weights are not present' do
|
||||||
@cli.parse(['sidekiq', '-q', 'foo,bar', '-r', './test/fake_env.rb'])
|
@cli.parse(['sidekiq', '-q', 'foo,bar', '-r', './test/fake_env.rb'])
|
||||||
assert_equal true, !!Sidekiq.options[:strict]
|
assert_equal true, !!Sidekiq.options[:strict]
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue