Added missing items in Puma config file.
This commit is contained in:
@@ -1,4 +1,23 @@
|
|||||||
workers = 2
|
workers 2
|
||||||
|
|
||||||
threads 2, 4
|
threads 2, 4
|
||||||
|
|
||||||
preload_app!
|
app_dir = File.expand_path("../..", __FILE__)
|
||||||
|
shared_dir = "#{app_dir}/shared"
|
||||||
|
|
||||||
|
rails_env = ENV['RAILS_ENV'] || "production"
|
||||||
|
environment rails_env
|
||||||
|
|
||||||
|
bind "unix://#{shared_dir}/sockets/puma.sock"
|
||||||
|
|
||||||
|
stdout_redirect "#{shared_dir}/log/puma.stdout.log", "#{shared_dir}/log/puma.stderr.log", true
|
||||||
|
|
||||||
|
pidfile "#{shared_dir}/pids/puma.pid"
|
||||||
|
state_path "#{shared_dir}/pids/puma.state"
|
||||||
|
activate_control_app
|
||||||
|
|
||||||
|
on_worker_boot do
|
||||||
|
require "active_record"
|
||||||
|
ActiveRecord::Base.connection.disconnect! rescue ActiveRecord::ConnectionNotEstablished
|
||||||
|
ActiveRecord::Base.establish_connection(YAML.load_file("#{app_dir}/config/database.yml")[rails_env])
|
||||||
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user