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.
gitea/services
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
..
agit Add more linters to improve code readability (#19989) 3 years ago
asymkey Refactor AssertExistsAndLoadBean to use generics (#20797) 2 years ago
attachment Refactor AssertExistsAndLoadBean to use generics (#20797) 2 years ago
auth Share HTML template renderers and create a watcher framework (#20218) 2 years ago
automerge Add more linters to improve code readability (#19989) 3 years ago
comments Move issues related files into models/issues (#19931) 3 years ago
context Move almost all functions' parameter db.Engine to context.Context (#19748) 3 years ago
cron Move some files into models' sub packages (#20262) 2 years ago
externalaccount Refactor auth package (#17962) 3 years ago
forms refactor webhook *NewPost (#20729) 3 years ago
gitdiff Refactor AssertExistsAndLoadBean to use generics (#20797) 2 years ago
issue Move some files into models' sub packages (#20262) 2 years ago
lfs Move some code into models/git (#19879) 3 years ago
mailer Share HTML template renderers and create a watcher framework (#20218) 2 years ago
migrations Move some files into models' sub packages (#20262) 2 years ago
mirror Add new API endpoints for push mirrors management (#19841) 3 years ago
org Move some files into models' sub packages (#20262) 2 years ago
packages Replace `ServeStream` with `ServeContent` (#20903) 2 years ago
pull Prevent 500 is head repo does not have PullRequest unit in IsUserAllowedToUpdate (#20839) 2 years ago
release Move some files into models' sub packages (#20262) 2 years ago
repository Move some files into models' sub packages (#20262) 2 years ago
task Move some files into models' sub packages (#20262) 2 years ago
user Refactor AssertExistsAndLoadBean to use generics (#20797) 2 years ago
webhook Refactor AssertExistsAndLoadBean to use generics (#20797) 2 years ago
wiki Move some files into models' sub packages (#20262) 2 years ago