Commit 8c44ca09 authored by Dmytro Zaporozhets's avatar Dmytro Zaporozhets

Merge branch 'sh-avoid-extra-route-reload' into 'master'

Speed up boot time in production

See merge request gitlab-org/gitlab!33929
parents 45fbbedf 114ea29c
---
title: Speed up boot time in production
merge_request: 33929
author:
type: performance
...@@ -301,7 +301,10 @@ module Gitlab ...@@ -301,7 +301,10 @@ module Gitlab
end end
config.after_initialize do config.after_initialize do
Rails.application.reload_routes! # Devise (see initializers/8_devise.rb) already reloads routes if
# eager loading is enabled, so don't do this twice since it's
# expensive.
Rails.application.reload_routes! unless config.eager_load
project_url_helpers = Module.new do project_url_helpers = Module.new do
extend ActiveSupport::Concern extend ActiveSupport::Concern
......
...@@ -6,6 +6,11 @@ Devise.setup do |config| ...@@ -6,6 +6,11 @@ Devise.setup do |config|
manager.default_strategies(scope: :user).unshift :two_factor_backupable manager.default_strategies(scope: :user).unshift :two_factor_backupable
end end
# This is the default. This makes it explicit that Devise loads routes
# before eager loading. Disabling this seems to cause an error loading
# grape-entity `expose` for some reason.
config.reload_routes = true
# ==> Mailer Configuration # ==> Mailer Configuration
# Configure the class responsible to send e-mails. # Configure the class responsible to send e-mails.
config.mailer = "DeviseMailer" config.mailer = "DeviseMailer"
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment