diff --git a/app/models/application_setting.rb b/app/models/application_setting.rb index e33a58d3771..6b3f0d4ee20 100644 --- a/app/models/application_setting.rb +++ b/app/models/application_setting.rb @@ -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 diff --git a/config/initializers/1_settings.rb b/config/initializers/1_settings.rb index 906ec11f012..4f33aad8693 100644 --- a/config/initializers/1_settings.rb +++ b/config/initializers/1_settings.rb @@ -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