aboutsummaryrefslogtreecommitdiffstats
path: root/modules/templates/htmlrenderer.go
diff options
context:
space:
mode:
Diffstat (limited to 'modules/templates/htmlrenderer.go')
-rw-r--r--modules/templates/htmlrenderer.go12
1 files changed, 9 insertions, 3 deletions
diff --git a/modules/templates/htmlrenderer.go b/modules/templates/htmlrenderer.go
index 311e5b741d..21c268da78 100644
--- a/modules/templates/htmlrenderer.go
+++ b/modules/templates/htmlrenderer.go
@@ -96,6 +96,14 @@ func HTMLRenderer() *HTMLRender {
return htmlRender
}
+func ReloadHTMLTemplates() error {
+ if err := htmlRender.CompileTemplates(); err != nil {
+ log.Error("Template error: %v\n%s", err, log.Stack(2))
+ return err
+ }
+ return nil
+}
+
func initHTMLRenderer() {
rendererType := "static"
if !setting.IsProd {
@@ -115,9 +123,7 @@ func initHTMLRenderer() {
if !setting.IsProd {
go AssetFS().WatchLocalChanges(graceful.GetManager().ShutdownContext(), func() {
- if err := htmlRender.CompileTemplates(); err != nil {
- log.Error("Template error: %v\n%s", err, log.Stack(2))
- }
+ _ = ReloadHTMLTemplates()
})
}
}