Created
October 11, 2015 17:11
-
-
Save excid3/4d7d5e7086b48d556261 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment