mirror of
https://github.com/mperham/sidekiq.git
synced 2022-11-09 13:52:34 -05:00
prevent invalid concurrency from causing hard to debug problems
cocurrency 0 makes the manager just sit there and do nothing, which is hard to debug / understand without knowing what to look for
This commit is contained in:
parent
a64333bd1d
commit
8c82a9f3d9
2 changed files with 6 additions and 0 deletions
|
@ -27,6 +27,7 @@ module Sidekiq
|
|||
logger.debug { options.inspect }
|
||||
@options = options
|
||||
@count = options[:concurrency] || 25
|
||||
raise ArgumentError, "Concurrency of #{@count} is not supported" if @count < 1
|
||||
@done_callback = nil
|
||||
@finished = condvar
|
||||
|
||||
|
|
|
@ -88,6 +88,11 @@ class TestManager < Sidekiq::Test
|
|||
fetcher.verify
|
||||
end
|
||||
|
||||
it 'does not support invalid concurrency' do
|
||||
assert_raises(ArgumentError) { new_manager(concurrency: 0) }
|
||||
assert_raises(ArgumentError) { new_manager(concurrency: -1) }
|
||||
end
|
||||
|
||||
describe 'heartbeat' do
|
||||
before do
|
||||
uow = Object.new
|
||||
|
|
Loading…
Reference in a new issue