diff options
author | Nick Thomas <nick@gitlab.com> | 2017-07-10 15:29:16 +0300 |
---|---|---|
committer | Nick Thomas <nick@gitlab.com> | 2017-07-10 17:40:51 +0300 |
commit | aeb2869f666a73a039b5ac05bc5973547456ee33 (patch) | |
tree | d68a0bc1bcc0188e7847c4f9953da6ab9e534e10 /app/models/application_setting.rb | |
parent | cd735170d3bc5e71d46ba1e37249ae713b7842f8 (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.rb | 3 |
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 |