summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorDJ Mountney <david@twkie.net>2016-05-29 12:53:30 -0700
committerDJ Mountney <david@twkie.net>2016-05-29 12:53:30 -0700
commitc8eb1dccabe5cd961895127dbbbf46d3eee4aebd (patch)
treeff0cbe5365a23825fb3851bf9b3ca528c534ed63 /lib
parent7d57b110934f50225142789a93a0d4f54cf446f7 (diff)
downloadgitlab-ce-c8eb1dccabe5cd961895127dbbbf46d3eee4aebd.tar.gz
Try and use cache for application settings even when the db is not connectedcurrent-settings-use-request-store-during-request
Diffstat (limited to 'lib')
-rw-r--r--lib/gitlab/current_settings.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/gitlab/current_settings.rb b/lib/gitlab/current_settings.rb
index 59e86707d3e..1a4ddd38513 100644
--- a/lib/gitlab/current_settings.rb
+++ b/lib/gitlab/current_settings.rb
@@ -9,9 +9,9 @@ module Gitlab
end
def ensure_application_settings!
- settings = nil
+ settings = ::ApplicationSetting.cached
- if connect_to_db?
+ if !settings && connect_to_db?
settings = ::ApplicationSetting.current
settings ||= ::ApplicationSetting.create_from_defaults unless ActiveRecord::Migrator.needs_migration?
end