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:
parent
aaabdc9a75
commit
9cf8659ef5
2 changed files with 9 additions and 0 deletions
|
@ -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
|
||||
|
|
|
@ -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]
|
||||
|
|
Loading…
Add table
Reference in a new issue