1
0
Fork 0
mirror of https://github.com/puma/puma.git synced 2022-11-09 13:48:40 -05:00

Use integers when comparing thread counts

When setting min & max via ENV var (PUMA_THREAD_COUNT="6:12") one will
get a RuntimeError, because "6" > "12".
This commit is contained in:
jc00ke 2013-07-31 16:20:09 -07:00
parent 2ef57daf8b
commit 6222d80803

View file

@ -258,8 +258,10 @@ module Puma
# requests and +max+ the maximum.
#
def threads(min, max)
min = Integer(min)
max = Integer(max)
if min > max
raise "The minimum number of threads must be less than the max"
raise "The minimum (#{min}) number of threads must be less than the max (#{max})"
end
@options[:min_threads] = min