Commit e745e1aa authored by Rémy Coutable's avatar Rémy Coutable

Move a begin/rescue clause to ApplicationSetting.expire

Also, remove non-existing Ci::ApplicationSetting.expire!
Signed-off-by: default avatarRémy Coutable <remy@rymai.me>
parent d777e6f1
...@@ -199,6 +199,9 @@ class ApplicationSetting < ActiveRecord::Base ...@@ -199,6 +199,9 @@ class ApplicationSetting < ActiveRecord::Base
def self.expire def self.expire
Rails.cache.delete(CACHE_KEY) Rails.cache.delete(CACHE_KEY)
rescue
# Gracefully handle when Redis is not available. For example,
# omnibus may fail here during assets:precompile.
end end
def self.cached def self.cached
......
...@@ -419,10 +419,4 @@ if Rails.env.test? ...@@ -419,10 +419,4 @@ if Rails.env.test?
end end
# Force a refresh of application settings at startup # Force a refresh of application settings at startup
begin ApplicationSetting.expire
ApplicationSetting.expire
Ci::ApplicationSetting.expire
rescue
# Gracefully handle when Redis is not available. For example,
# omnibus may fail here during assets:precompile.
end
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment