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:
parent
d777e6f1da
commit
e745e1aae0
|
@ -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?
|
||||||
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
|
|
||||||
|
|
Loading…
Reference in New Issue