File tree Expand file tree Collapse file tree 1 file changed +1
-23
lines changed Expand file tree Collapse file tree 1 file changed +1
-23
lines changed Original file line number Diff line number Diff line change 2626# Use the `preload_app!` method when specifying a `workers` number.
2727# This directive tells Puma to first boot the application and load code
2828# before forking the application. This takes advantage of Copy On Write
29- # process behavior so workers use less memory. If you use this option
30- # you need to make sure to reconnect any threads in the `on_worker_boot`
31- # block.
29+ # process behavior so workers use less memory.
3230#
3331preload_app!
3432
35- # If you are preloading your application and using Active Record, it's
36- # recommended that you close any connections to the database before workers
37- # are forked to prevent connection leakage.
38- #
39- # before_fork do
40- # ActiveRecord::Base.connection_pool.disconnect! if defined?(ActiveRecord)
41- # end
42-
43- # The code in the `on_worker_boot` will be called if you are using
44- # clustered mode by specifying a number of `workers`. After each worker
45- # process is booted, this block will be run. If you are using the `preload_app!`
46- # option, you will want to use this block to reconnect to any threads
47- # or connections that may have been created at application boot, as Ruby
48- # cannot share connections between processes.
49- #
50- # on_worker_boot do
51- # ActiveRecord::Base.establish_connection if defined?(ActiveRecord)
52- # end
53- #
54-
5533# Allow puma to be restarted by `rails restart` command.
5634plugin :tmp_restart
5735
You can’t perform that action at this time.
0 commit comments