Simplify puma config

sites
aeris 3 years ago
parent 18fed00b19
commit 0baa162d7b
  1. 15
      config/puma.rb

@ -3,21 +3,10 @@ threads threads_count, threads_count
env = ENV.fetch 'RAILS_ENV', 'development'
environment env
unless Rails.root
module Rails
ROOT = Dir.pwd
def self.root
ROOT
end
end
end
workers ENV.fetch('WORKER', 4).to_i
if env == 'production'
listen = ENV.fetch('LISTEN') { 'unix://' + File.join(Rails.root, 'tmp/sockets/puma.sock') }
listen = ENV.fetch('LISTEN') { 'unix://' + File.join(Dir.pwd, 'tmp/sockets/puma.sock') }
port = ENV['PORT']
else
listen = ENV['LISTEN']
@ -27,6 +16,6 @@ end
port(port) if port
bind listen if listen
pidfile File.join Rails.root, 'tmp/pids/puma.pid'
pidfile File.join Dir.pwd, 'tmp/pids/puma.pid'
plugin :tmp_restart

Loading…
Cancel
Save