diff options
Diffstat (limited to 'app/models/application_setting.rb')
-rw-r--r-- | app/models/application_setting.rb | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/app/models/application_setting.rb b/app/models/application_setting.rb index 3568e72e463..2216ac0402d 100644 --- a/app/models/application_setting.rb +++ b/app/models/application_setting.rb @@ -194,7 +194,10 @@ class ApplicationSetting < ActiveRecord::Base ensure_cache_setup Rails.cache.fetch(CACHE_KEY) do - ApplicationSetting.last + ApplicationSetting.last.tap do |settings| + # do not cache nils + raise 'missing settings' unless settings + end end rescue # Fall back to an uncached value if there are any problems (e.g. redis down) |