Skip to content
Snippets Groups Projects
Unverified Commit 826fd47a authored by Bryan Maass's avatar Bryan Maass Committed by GitHub
Browse files

Stop stacktrace on shutdown + current site-locale (#21831)

parent 59cea30c
No related branches found
No related tags found
No related merge requests found
......@@ -190,9 +190,16 @@
(f)))))))))
(defn site-locale-from-setting
"Fetch the value of the `site-locale` Setting."
"Fetch the value of the `site-locale` Setting.
When metabase is shutting down, we need to log some messages after the db connection is closed, so we keep around a
cached-site-locale for that purpose."
[]
(@site-locale-from-setting-fn))
(let [cached-site-locale (atom "en")]
(try
(let [site-locale (@site-locale-from-setting-fn)]
(reset! cached-site-locale site-locale)
site-locale)
(catch Exception e @cached-site-locale))))
(defmethod print-method Locale
[locale ^java.io.Writer writer]
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment