summaryrefslogtreecommitdiffstats
path: root/routers/init.go
diff options
context:
space:
mode:
authorwxiaoguang <wxiaoguang@gmail.com>2023-04-30 14:22:23 +0200
committerGitHub <noreply@github.com>2023-04-30 14:22:23 +0200
commite3750370df3be1413b1526668cbee60dc2a39f03 (patch)
treecc61431d00e62df1a8be5e2f050105749ddad5e8 /routers/init.go
parentRework header bar on issue, pull requests and milestone (#24420) (diff)
downloadforgejo-e3750370df3be1413b1526668cbee60dc2a39f03.tar.xz
forgejo-e3750370df3be1413b1526668cbee60dc2a39f03.zip
Use globally shared HTMLRender (#24436)
The old `HTMLRender` is not ideal. 1. It shouldn't be initialized multiple times, it consumes a lot of memory and is slow. 2. It shouldn't depend on short-lived requests, the `WatchLocalChanges` needs a long-running context. 3. It doesn't make sense to use FuncsMap slice. HTMLRender was designed to only work for GItea's specialized 400+ templates, so it's good to make it a global shared instance.
Diffstat (limited to 'routers/init.go')
-rw-r--r--routers/init.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/routers/init.go b/routers/init.go
index 2c26bb5b07..358922b1ae 100644
--- a/routers/init.go
+++ b/routers/init.go
@@ -175,7 +175,7 @@ func GlobalInitInstalled(ctx context.Context) {
// NormalRoutes represents non install routes
func NormalRoutes(ctx context.Context) *web.Route {
- ctx, _ = templates.HTMLRenderer(ctx)
+ _ = templates.HTMLRenderer()
r := web.NewRoute()
r.Use(common.ProtocolMiddlewares()...)