mirror of
https://github.com/mperham/sidekiq.git
synced 2022-11-09 13:52:34 -05:00
Simplify
This commit is contained in:
parent
a48e7bee39
commit
edd389d095
1 changed files with 2 additions and 17 deletions
|
@ -270,23 +270,8 @@ module Sidekiq
|
|||
die(1)
|
||||
end
|
||||
|
||||
# Ensure numeric option values are numbers and fall in reasonable ranges
|
||||
[:concurrency, :timeout].each do |option|
|
||||
next unless options.has_key?(option)
|
||||
|
||||
unless options[option].is_a? Integer
|
||||
raise(
|
||||
ArgumentError,
|
||||
%{"#{option}": "#{options[option]}" is not a valid integer}
|
||||
)
|
||||
end
|
||||
|
||||
if options[option] <= 0
|
||||
raise(
|
||||
ArgumentError,
|
||||
%{"#{option}": must be > 0 (current value: #{options[option]})}
|
||||
)
|
||||
end
|
||||
[:concurrency, :timeout].each do |opt|
|
||||
raise ArgumentError, "#{opt}: #{options[opt]} is not a valid value" if options.has_key?(opt) && options[opt].to_i <= 0
|
||||
end
|
||||
end
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue