From cd1e70a3bced0c911477c7b65fdea0734d360fcd Mon Sep 17 00:00:00 2001 From: Harald Eilertsen Date: Wed, 12 Sep 2018 20:23:39 +0200 Subject: Fixup prod/dev logic in puma config. --- config/puma.rb | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) (limited to 'config') diff --git a/config/puma.rb b/config/puma.rb index 62073b5..cd7089a 100644 --- a/config/puma.rb +++ b/config/puma.rb @@ -1,9 +1,11 @@ #!/usr/bin/env puma -if get(:environment) == "production" +if @config.environment.call == "production" root = "../../shared" + socket = "unix://../../shared/tmp/sockets/puma.sock" else root = "." + socket = "tcp://localhost:3000" end # Store the pid of the server in the file at “path”. @@ -22,11 +24,7 @@ state_path "#{root}/tmp/pids/puma.state" stdout_redirect "#{root}/log/puma.stdout.log", "#{root}/log/puma.stderr.log" -if get(:environment) == "production" - bind "unix://../../shared/tmp/sockets/puma.sock" -else - bind "tcp://localhost:3000" -end +bind socket # === Cluster mode === -- cgit v1.2.3