Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
authorStan Hu <stanhu@gmail.com>2017-07-10 18:55:08 +0300
committerClement Ho <ClemMakesApps@gmail.com>2017-07-12 18:35:46 +0300
commit462ef2d83840195ea77c1c41abec6e2bfbe0fa02 (patch)
treedbef8d3f772b416d3440da5f28ee5ef16593d988 /app
parentb9a169cf418891a33a01c513340adfa2c7d2a3f7 (diff)
Merge branch '34728-fix-application-setting-created-when-redis-down' into 'master'
Prevent bad data being added to application settings when Redis is unavailable Closes #34728 See merge request !12750
Diffstat (limited to 'app')
-rw-r--r--app/models/application_setting.rb3
1 files changed, 3 insertions, 0 deletions
diff --git a/app/models/application_setting.rb b/app/models/application_setting.rb
index 2192f76499d..aee4db6ae5b 100644
--- a/app/models/application_setting.rb
+++ b/app/models/application_setting.rb
@@ -179,6 +179,9 @@ class ApplicationSetting < ActiveRecord::Base
Rails.cache.fetch(CACHE_KEY) do
ApplicationSetting.last
end
+ rescue
+ # Fall back to an uncached value if there are any problems (e.g. redis down)
+ ApplicationSetting.last
end
def self.expire