Module: Workarea::Configuration::Puma
Instance Method Summary collapse
Instance Method Details
#environment ⇒ Object
28 29 30 |
# File 'lib/workarea/configuration/puma.rb', line 28 def environment ENV.fetch('RAILS_ENV') { 'development' } end |
#load(puma) ⇒ Object
6 7 8 9 10 11 12 13 14 15 16 17 18 |
# File 'lib/workarea/configuration/puma.rb', line 6 def load(puma) puma.port(port) puma.threads(threads, threads) puma.environment(environment) if workers.present? puma.workers(workers) puma.preload_app! end puma.plugin(:tmp_restart) puma.set_remote_address(header: 'X-Real-IP') # For hosted environments end |
#port ⇒ Object
20 21 22 |
# File 'lib/workarea/configuration/puma.rb', line 20 def port ENV.fetch('PORT') { 3000 } end |
#threads ⇒ Object
24 25 26 |
# File 'lib/workarea/configuration/puma.rb', line 24 def threads ENV.fetch('RAILS_MAX_THREADS') { 5 } end |
#workers ⇒ Object
32 33 34 |
# File 'lib/workarea/configuration/puma.rb', line 32 def workers ENV.fetch('WEB_CONCURRENCY') { nil } end |