Merge pull request #26487 from prathamesh-sonpatki/move-preload-section-up

Move comment about disconnecting pool close to comment about preload
This commit is contained in:
Richard Schneeman 2016-09-14 10:26:46 -05:00 committed by GitHub
commit 1d7b00d607

@ -32,6 +32,14 @@
#
# preload_app!
# If you are preloading your application and using Active Record, it's
# recommended that you close any connections to the database before workers
# are forked to prevent connection leakage.
#
# before_fork do
# ActiveRecord::Base.connection_pool.disconnect! if defined?(ActiveRecord)
# end
# The code in the `on_worker_boot` will be called if you are using
# clustered mode by specifying a number of `workers`. After each worker
# process is booted this block will be run, if you are using `preload_app!`
@ -43,13 +51,6 @@
# ActiveRecord::Base.establish_connection if defined?(ActiveRecord)
# end
#
# If you are preloading your application and using ActiveRecord, it's
# recommended that you close any connections to the database before workers
# are forked to prevent connection leakage.
#
# before_fork do
# ActiveRecord::Base.connection_pool.disconnect! if defined?(ActiveRecord)
# end
# Allow puma to be restarted by `rails restart` command.
plugin :tmp_restart