1
0
Fork 0
mirror of https://github.com/mperham/sidekiq.git synced 2022-11-09 13:52:34 -05:00

Add cli arg for unique process index

This commit is contained in:
Mike Perham 2013-01-06 13:01:30 -08:00
parent aaabdc9a75
commit 9cf8659ef5
2 changed files with 9 additions and 0 deletions

View file

@ -192,6 +192,10 @@ module Sidekiq
opts[:require] = arg
end
o.on '-i', '--index INT', "unique process index on this machine" do |arg|
opts[:index] = Integer(arg)
end
o.on '-c', '--concurrency INT', "processor threads to use" do |arg|
opts[:concurrency] = Integer(arg)
end

View file

@ -40,6 +40,11 @@ class TestCli < MiniTest::Unit::TestCase
assert_equal ['foo'], Sidekiq.options[:queues]
end
it 'accepts a process index' do
@cli.parse(['sidekiq', '-i', '7', '-r', './test/fake_env.rb'])
assert_equal 7, Sidekiq.options[:index]
end
it 'sets strictly ordered queues if weights are not present' do
@cli.parse(['sidekiq', '-q', 'foo,bar', '-r', './test/fake_env.rb'])
assert_equal true, !!Sidekiq.options[:strict]