mirror of
https://github.com/ENSL/ensl.org.git
synced 2025-02-28 23:01:05 +00:00
Update puma for debug
This commit is contained in:
parent
d3ef9db9e9
commit
00354fe6b3
1 changed files with 16 additions and 5 deletions
|
@ -1,32 +1,43 @@
|
||||||
|
# Load dev vars
|
||||||
|
# FIXME: right dev file is not loaded
|
||||||
require "dotenv"
|
require "dotenv"
|
||||||
Dotenv.load()
|
Dotenv.load()
|
||||||
|
|
||||||
tag 'ENSL'
|
tag 'ENSL'
|
||||||
|
|
||||||
|
# Preload to save memory,
|
||||||
preload_app!
|
preload_app!
|
||||||
|
|
||||||
|
# Start in foreground mode
|
||||||
daemonize false
|
daemonize false
|
||||||
|
|
||||||
|
# Rack up?
|
||||||
rackup DefaultRackup
|
rackup DefaultRackup
|
||||||
|
|
||||||
|
# Set vars as we cannmot load them
|
||||||
rails_env = ENV['RAILS_ENV'] || 'development'
|
rails_env = ENV['RAILS_ENV'] || 'development'
|
||||||
app_dir = ENV['DEPLOY_PATH'] || '/var/www'
|
app_dir = ENV['DEPLOY_PATH'] || '/var/www'
|
||||||
|
|
||||||
|
# Set basic puma settings
|
||||||
environment rails_env
|
environment rails_env
|
||||||
bind "unix://#{app_dir}/tmp/sockets/puma.sock"
|
bind "unix://#{app_dir}/tmp/sockets/puma.sock"
|
||||||
port Integer(ENV['PUMA_PORT'] || 4000)
|
port Integer(ENV['PUMA_PORT'] || 4000)
|
||||||
|
|
||||||
|
# Redirect stdout only in production. Dev mode needs it for debug
|
||||||
|
if rails_env.downcase != 'development'
|
||||||
stdout_redirect "#{app_dir}/log/puma.stdout.log", \
|
stdout_redirect "#{app_dir}/log/puma.stdout.log", \
|
||||||
"#{app_dir}/log/puma.stderr.log", true
|
"#{app_dir}/log/puma.stderr.log", true
|
||||||
|
end
|
||||||
|
|
||||||
#pidfile "#{base_path}/tmp/pids/puma.pid"
|
pidfile "#{app_dir}/tmp/pids/puma.pid"
|
||||||
#state_path "#{base_path}/tmp/pids/puma.state"
|
state_path "#{app_dir}/tmp/puma.state"
|
||||||
#stdout_redirect stdout_path, stderr_path
|
|
||||||
|
|
||||||
# FIXME: sometimes the app becomes super slow if workers are used, investigate
|
# FIXME: sometimes the app becomes super slow if workers are used, investigate
|
||||||
workers Integer(ENV['PUMA_WORKERS']) if (ENV.has_key?("PUMA_WORKERS") && ENV['PUMA_WORKERS'].to_i > 0)
|
workers Integer(ENV['PUMA_WORKERS']) if (ENV.has_key?("PUMA_WORKERS") && ENV['PUMA_WORKERS'].to_i > 0)
|
||||||
worker_timeout Integer(ENV['PUMA_TIMEOUT'] || 30)
|
worker_timeout Integer(ENV['PUMA_TIMEOUT'] || 30)
|
||||||
threads Integer(ENV['PUMA_MIN_THREADS'] || 1), Integer(ENV['PUMA_MAX_THREADS'] || 16)
|
threads Integer(ENV['PUMA_MIN_THREADS'] || 1), Integer(ENV['PUMA_MAX_THREADS'] || 16)
|
||||||
|
|
||||||
|
# Allow restart via file
|
||||||
plugin :tmp_restart
|
plugin :tmp_restart
|
||||||
|
|
||||||
on_worker_boot do
|
on_worker_boot do
|
||||||
|
|
Loading…
Reference in a new issue