Skip to content

Commit

Permalink
Simplify
Browse files Browse the repository at this point in the history
  • Loading branch information
mperham committed May 15, 2015
1 parent a48e7be commit edd389d
Showing 1 changed file with 2 additions and 17 deletions.
19 changes: 2 additions & 17 deletions lib/sidekiq/cli.rb
Expand Up @@ -270,23 +270,8 @@ def validate!
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

Expand Down

0 comments on commit edd389d

Please sign in to comment.