Move a begin/rescue clause to ApplicationSetting.expire

Also, remove non-existing Ci::ApplicationSetting.expire!

Signed-off-by: Rémy Coutable <remy@rymai.me>
This commit is contained in:
Rémy Coutable 2017-01-26 12:45:14 +01:00
parent d777e6f1da
commit e745e1aae0
2 changed files with 4 additions and 7 deletions

View File

@ -199,6 +199,9 @@ class ApplicationSetting < ActiveRecord::Base
def self.expire
Rails.cache.delete(CACHE_KEY)
rescue
# Gracefully handle when Redis is not available. For example,
# omnibus may fail here during assets:precompile.
end
def self.cached

View File

@ -419,10 +419,4 @@ if Rails.env.test?
end
# Force a refresh of application settings at startup
begin
ApplicationSetting.expire
Ci::ApplicationSetting.expire
rescue
# Gracefully handle when Redis is not available. For example,
# omnibus may fail here during assets:precompile.
end
ApplicationSetting.expire