aboutsummaryrefslogtreecommitdiffstats
path: root/railties/lib/rails/application
diff options
context:
space:
mode:
authorJonathan Boler <galatians@gmail.com>2018-06-19 16:25:39 -0500
committerJonathan Boler <galatians@gmail.com>2018-06-19 16:25:39 -0500
commit869ba3ec62aa3a440edda7c1af3276445b56546b (patch)
treebaf2867ee9907b087c3e663fa58f5cc2b52b59fb /railties/lib/rails/application
parent3674ccd444275fd17cc453add398985a43acb056 (diff)
downloadrails-869ba3ec62aa3a440edda7c1af3276445b56546b.tar.gz
rails-869ba3ec62aa3a440edda7c1af3276445b56546b.tar.bz2
rails-869ba3ec62aa3a440edda7c1af3276445b56546b.zip
Only execute route updater once on app boot
Diffstat (limited to 'railties/lib/rails/application')
-rw-r--r--railties/lib/rails/application/finisher.rb2
-rw-r--r--railties/lib/rails/application/routes_reloader.rb6
2 files changed, 2 insertions, 6 deletions
diff --git a/railties/lib/rails/application/finisher.rb b/railties/lib/rails/application/finisher.rb
index c4b188aeee..04aaf6dd9a 100644
--- a/railties/lib/rails/application/finisher.rb
+++ b/railties/lib/rails/application/finisher.rb
@@ -127,7 +127,7 @@ module Rails
initializer :set_routes_reloader_hook do |app|
reloader = routes_reloader
reloader.eager_load = app.config.eager_load
- reloader.execute_if_updated
+ reloader.execute
reloaders << reloader
app.reloader.to_run do
# We configure #execute rather than #execute_if_updated because if
diff --git a/railties/lib/rails/application/routes_reloader.rb b/railties/lib/rails/application/routes_reloader.rb
index 916988a651..3ecb8e264e 100644
--- a/railties/lib/rails/application/routes_reloader.rb
+++ b/railties/lib/rails/application/routes_reloader.rb
@@ -27,11 +27,7 @@ module Rails
private
def updater
- @updater ||= begin
- updater = ActiveSupport::FileUpdateChecker.new(paths) { reload! }
- updater.execute
- updater
- end
+ @updater ||= ActiveSupport::FileUpdateChecker.new(paths) { reload! }
end
def clear!