You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

puma.rb 592B

1234567891011121314151617181920212223242526272829303132
  1. threads_count = ENV.fetch 'RAILS_MAX_THREADS', 5
  2. threads threads_count, threads_count
  3. env = ENV.fetch 'RAILS_ENV', 'development'
  4. environment env
  5. unless Rails.root
  6. module Rails
  7. ROOT = Dir.pwd
  8. def self.root
  9. ROOT
  10. end
  11. end
  12. end
  13. workers ENV.fetch('WORKER', 4).to_i
  14. if env == 'production'
  15. listen = ENV.fetch('LISTEN') { 'unix://' + File.join(Rails.root, 'tmp/sockets/puma.sock') }
  16. port = ENV['PORT']
  17. else
  18. listen = ENV['LISTEN']
  19. port = ENV.fetch 'PORT', 3000
  20. end
  21. port(port) if port
  22. bind listen if listen
  23. pidfile File.join Rails.root, 'tmp/pids/puma.pid'
  24. plugin :tmp_restart