mirror of https://github.com/rails/rails
Eager load the Rails default controllers used in production (#50558)
Since those controller can be used in production we need to eager load them to better copy-on-write and avoid tread-safety issues.
This commit is contained in:
parent
826a3d1545
commit
b0b1eb5a18
|
@ -27,13 +27,16 @@ module Rails
|
|||
extend ActiveSupport::Autoload
|
||||
extend ActiveSupport::Benchmarkable
|
||||
|
||||
autoload :HealthController
|
||||
autoload :Info
|
||||
autoload :InfoController
|
||||
autoload :MailersController
|
||||
autoload :PwaController
|
||||
autoload :WelcomeController
|
||||
|
||||
eager_autoload do
|
||||
autoload :HealthController
|
||||
autoload :PwaController
|
||||
end
|
||||
|
||||
class << self
|
||||
@application = @app_class = nil
|
||||
|
||||
|
|
|
@ -78,6 +78,7 @@ module Rails
|
|||
if config.eager_load
|
||||
ActiveSupport.run_load_hooks(:before_eager_load, self)
|
||||
Zeitwerk::Loader.eager_load_all
|
||||
Rails.eager_load!
|
||||
config.eager_load_namespaces.each(&:eager_load!)
|
||||
|
||||
if config.reloading_enabled?
|
||||
|
|
Loading…
Reference in New Issue