Try and use cache for application settings even when the db is not connected

This commit is contained in:
DJ Mountney
2016-05-29 12:53:30 -07:00
parent 7d57b11093
commit c8eb1dccab
2 changed files with 6 additions and 2 deletions
+2 -2
View File
@@ -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