You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
zeripath bb0ff77e46
Share HTML template renderers and create a watcher framework (#20218)
The recovery, API, Web and package frameworks all create their own HTML
Renderers. This increases the memory requirements of Gitea
unnecessarily with duplicate templates being kept in memory.

Further the reloading framework in dev mode for these involves locking
and recompiling all of the templates on each load. This will potentially
hide concurrency issues and it is inefficient.

This PR stores the templates renderer in the context and stores this
context in the NormalRoutes, it then creates a fsnotify.Watcher
framework to watch files.

The watching framework is then extended to the mailer templates which
were previously not being reloaded in dev.

Then the locales are simplified to a similar structure.

Fix #20210 
Fix #20211
Fix #20217

Signed-off-by: Andrew Thornton <art27@cantab.net>
2 years ago
..
admin Move some files into models' sub packages (#20262) 2 years ago
auth Move some files into models' sub packages (#20262) 2 years ago
dev Make better use of i18n (#20096) 2 years ago
events Improve Stopwatch behavior (#18930) 2 years ago
explore Only show relevant repositories on explore page (#19361) 2 years ago
feed Move some files into models' sub packages (#20262) 2 years ago
healthcheck Update go-chi/cache to utilize Ping() (#19719) 2 years ago
misc Fix panic in team repos API (#19431) 2 years ago
org Move some files into models' sub packages (#20262) 2 years ago
repo Replace `ServeStream` with `ServeContent` (#20903) 2 years ago
user Replace `ServeStream` with `ServeContent` (#20903) 2 years ago
auth.go Remove legacy `+build:` constraint (#19582) 2 years ago
auth_windows.go Let web and API routes have different auth methods group (#19168) 2 years ago
base.go Share HTML template renderers and create a watcher framework (#20218) 2 years ago
goget.go Refactor legacy `unknwon/com` package, improve golangci lint (#19284) 2 years ago
home.go Add sitemap support (#18407) 2 years ago
metrics.go Update HTTP status codes to modern codes (#18063) 2 years ago
nodeinfo.go Add nodeinfo endpoint for federation purposes (#16953) 3 years ago
swagger_json.go Refactor routers directory (#15800) 3 years ago
web.go Share HTML template renderers and create a watcher framework (#20218) 2 years ago
webfinger.go Fix various typos (#20338) 2 years ago