From 6222d8080352ccdaa105a11d1e4b2c6c6b6446ef Mon Sep 17 00:00:00 2001 From: jc00ke Date: Wed, 31 Jul 2013 16:20:09 -0700 Subject: [PATCH] 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". --- lib/puma/configuration.rb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/puma/configuration.rb b/lib/puma/configuration.rb index 92acfb1c..fa7be9bf 100644 --- a/lib/puma/configuration.rb +++ b/lib/puma/configuration.rb @@ -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