1
0

puma.rb 541 B

1234567891011121314151617181920212223
  1. persistent_timeout ENV.fetch('PERSISTENT_TIMEOUT') { 20 }.to_i
  2. threads_count = ENV.fetch('MAX_THREADS') { 5 }.to_i
  3. threads threads_count, threads_count
  4. if ENV['SOCKET']
  5. bind "unix://#{ENV['SOCKET']}"
  6. else
  7. bind "tcp://#{ENV.fetch('BIND', '127.0.0.1')}:#{ENV.fetch('PORT', 3000)}"
  8. end
  9. environment ENV.fetch('RAILS_ENV') { 'development' }
  10. workers ENV.fetch('WEB_CONCURRENCY') { 2 }
  11. preload_app!
  12. on_worker_boot do
  13. ActiveSupport.on_load(:active_record) do
  14. ActiveRecord::Base.establish_connection
  15. end
  16. end
  17. plugin :tmp_restart