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
diff options
context:
space:
mode:
authorNick Thomas <nick@gitlab.com>2017-07-10 15:29:16 +0300
committerNick Thomas <nick@gitlab.com>2017-07-10 17:40:51 +0300
commitaeb2869f666a73a039b5ac05bc5973547456ee33 (patch)
treed68a0bc1bcc0188e7847c4f9953da6ab9e534e10 /app/models/application_setting.rb
parentcd735170d3bc5e71d46ba1e37249ae713b7842f8 (diff)
Prevent bad data being added to application settings when Redis is unavailable
Diffstat (limited to 'app/models/application_setting.rb')
-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 14516091495..98e3906a932 100644
--- a/app/models/application_setting.rb
+++ b/app/models/application_setting.rb
@@ -184,6 +184,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