Skip to content

A platform for community discussion. Free, open, simple.

PERF: Preload client settings json while booting app. (#13283)

Alan Guo Xiang Tan2717615f1176
diff --git a/lib/discourse.rb b/lib/discourse.rb
index 779f8634caf..dd6b65ee575 100644
--- a/lib/discourse.rb
+++ b/lib/discourse.rb
@@ -942,6 +942,14 @@ module Discourse
JsLocaleHelper.load_translations(SiteSetting.default_locale)
Site.json_for(Guardian.new)
SvgSprite.preload
+
+ begin
+ SiteSetting.client_settings_json
+ rescue => e
+ # Rescue from Redis related errors so that we can still boot the
+ # application even if Redis is down.
+ warn_exception(e, message: "Error while preloading client settings json")
+ end
end
[