mirror of
https://github.com/danbee/danbarberphoto
synced 2025-03-04 08:49:07 +00:00
Update puma config.
This commit is contained in:
parent
4ef40d5611
commit
89d3af759a
2
Procfile
2
Procfile
@ -1 +1 @@
|
||||
web: bundle exec puma -p $PORT -e $RACK_ENV -t 0:5
|
||||
web: bundle exec puma -C config/puma.rb
|
||||
|
||||
18
config/puma.rb
Normal file
18
config/puma.rb
Normal file
@ -0,0 +1,18 @@
|
||||
workers Integer(ENV['PUMA_WORKERS'] || 3)
|
||||
threads Integer(ENV['MIN_THREADS'] || 1), Integer(ENV['MAX_THREADS'] || 16)
|
||||
|
||||
preload_app!
|
||||
|
||||
rackup DefaultRackup
|
||||
port ENV['PORT'] || 3000
|
||||
environment ENV['RACK_ENV'] || 'development'
|
||||
|
||||
on_worker_boot do
|
||||
# worker specific setup
|
||||
ActiveSupport.on_load(:active_record) do
|
||||
config = ActiveRecord::Base.configurations[Rails.env] ||
|
||||
Rails.application.config.database_configuration[Rails.env]
|
||||
config['pool'] = ENV['MAX_THREADS'] || 16
|
||||
ActiveRecord::Base.establish_connection(config)
|
||||
end
|
||||
end
|
||||
Loading…
Reference in New Issue
Block a user