#!/usr/bin/env puma

rackup      DefaultRackup
daemonize   false
environment ENV.fetch('RACK_ENV', 'development')
workers     ENV.fetch('WEB_CONCURRENCY', 2) unless Rails.env.development?
threads     ENV.fetch('MAX_THREADS', 5), ENV.fetch('MAX_THREADS', 5)
port        ENV.fetch('PORT', 3000)

preload_app!

on_worker_boot do
  ActiveRecord::Base.establish_connection
end

#!/usr/bin/env puma

rack_env = ENV.fetch('RACK_ENV', 'development')

rackup      DefaultRackup
daemonize   false
environment rack_env
workers     ENV.fetch('WEB_CONCURRENCY', 2) unless rack_env == 'development'
threads     ENV.fetch('MAX_THREADS', 5), ENV.fetch('MAX_THREADS', 5)
port        ENV.fetch('PORT', 3000)

preload_app!

on_worker_boot do
  ActiveRecord::Base.establish_connection
end

Use RACK_ENV to check for development environment
Use RACK_ENV to check for development environment

The Rails constant isn't available when booting puma directly so use
the environment variable to check for development mode.
