Browse Source

Simplify puma config

master
aeris 7 months ago
parent
commit
0baa162d7b
1 changed files with 2 additions and 13 deletions
  1. +2
    -13
      config/puma.rb

+ 2
- 13
config/puma.rb View File

@@ -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