Skip to content

Commit

Permalink
using defined Puma config
Browse files Browse the repository at this point in the history
This changes threads the `gemstash_env.config` options for Puma through
to the `Puma::CLI.new` call.

Prior to this change `:puma_workers` and `:puma_threads` were ignored
when booting Gemstash via the CLI
  • Loading branch information
JackDanger committed Dec 6, 2018
1 parent c31975f commit df148bf
Showing 1 changed file with 15 additions and 3 deletions.
18 changes: 15 additions & 3 deletions lib/gemstash/cli/start.rb
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,24 @@ def puma_config
File.expand_path("../../puma.rb", __FILE__)
end

def store_pidfile
gemstash_env.pidfile = pidfile?
end

def pidfile?
@cli.options[:pidfile]
end

def args
config_args + pidfile_args + daemonize_args
puma_args + pidfile_args + daemonize_args
end

def config_args
["--config", puma_config]
def puma_args
[
'--config', puma_config,
'--workers', gemstash_env.config[:puma_workers],
'--threads', gemstash_env.config[:puma_threads],
]
end

def daemonize_args
Expand Down

0 comments on commit df148bf

Please sign in to comment.