diff --git a/lib/gemstash/cli/start.rb b/lib/gemstash/cli/start.rb index 57dc1d38..13c8a18f 100644 --- a/lib/gemstash/cli/start.rb +++ b/lib/gemstash/cli/start.rb @@ -32,16 +32,28 @@ def daemonize? @cli.options[:daemonize] end - def puma_config - File.expand_path("../puma.rb", __dir__) + def args + puma_args + pidfile_args + daemonize_args end - def args - config_args + pidfile_args + daemonize_args + def puma_args + [ + "--config", puma_config, + "--workers", puma_workers, + "--threads", puma_threads + ] + end + + def puma_workers + gemstash_env.config[:puma_workers] ? gemstash_env.config[:puma_workers].to_s : "0" + end + + def puma_threads + gemstash_env.config[:puma_threads] ? gemstash_env.config[:puma_threads].to_s : "0" end - def config_args - ["--config", puma_config] + def puma_config + File.expand_path("../puma.rb", __dir__) end def daemonize_args