aboutsummaryrefslogtreecommitdiffstats
path: root/railties
diff options
context:
space:
mode:
authorPrathamesh Sonpatki <csonpatki@gmail.com>2016-09-14 10:34:34 +0530
committerPrathamesh Sonpatki <csonpatki@gmail.com>2016-09-14 10:34:34 +0530
commit1b6f3a2ef7de3c1d22123659504b100c418da872 (patch)
treefd25796ec1375b90c61a4d63b88294da51e669f9 /railties
parent92703a9ea5d8b96f30e0b706b801c9185ef14f0e (diff)
downloadrails-1b6f3a2ef7de3c1d22123659504b100c418da872.tar.gz
rails-1b6f3a2ef7de3c1d22123659504b100c418da872.tar.bz2
rails-1b6f3a2ef7de3c1d22123659504b100c418da872.zip
Move comment about disconnecting pool close to comment about preload
- These two comments are connected to each other so kept them back to back.
Diffstat (limited to 'railties')
-rw-r--r--railties/lib/rails/generators/rails/app/templates/config/puma.rb15
1 files changed, 8 insertions, 7 deletions
diff --git a/railties/lib/rails/generators/rails/app/templates/config/puma.rb b/railties/lib/rails/generators/rails/app/templates/config/puma.rb
index a44bfbabec..7ee948002e 100644
--- a/railties/lib/rails/generators/rails/app/templates/config/puma.rb
+++ b/railties/lib/rails/generators/rails/app/templates/config/puma.rb
@@ -32,6 +32,14 @@ environment ENV.fetch("RAILS_ENV") { "development" }
#
# 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 @@ environment ENV.fetch("RAILS_ENV") { "development" }
# 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