aboutsummaryrefslogtreecommitdiffstats
path: root/modules/private/manager.go
diff options
context:
space:
mode:
authorBrecht Van Lommel <brecht@blender.org>2023-05-22 17:51:40 +0200
committerGitHub <noreply@github.com>2023-05-22 23:51:40 +0800
commit3588edbb08f93aaa56defa82dffdbb202cd9aa4a (patch)
treead3b571f18534d3932642d3c069c495a31e9966c /modules/private/manager.go
parent922c83eea3407746a0472e5e3ad8b78a3136c661 (diff)
downloadgitea-3588edbb08f93aaa56defa82dffdbb202cd9aa4a.tar.gz
gitea-3588edbb08f93aaa56defa82dffdbb202cd9aa4a.zip
Add gitea manager reload-templates command (#24843)
This can be useful to update custom templates in production mode, when they are updated frequently and a full Gitea restart each time is disruptive.
Diffstat (limited to 'modules/private/manager.go')
-rw-r--r--modules/private/manager.go7
1 files changed, 7 insertions, 0 deletions
diff --git a/modules/private/manager.go b/modules/private/manager.go
index a974c3ed05..382986bf1d 100644
--- a/modules/private/manager.go
+++ b/modules/private/manager.go
@@ -29,6 +29,13 @@ func Restart(ctx context.Context) ResponseExtra {
return requestJSONClientMsg(req, "Restarting")
}
+// ReloadTemplates calls the internal reload-templates function
+func ReloadTemplates(ctx context.Context) ResponseExtra {
+ reqURL := setting.LocalURL + "api/internal/manager/reload-templates"
+ req := newInternalRequest(ctx, reqURL, "POST")
+ return requestJSONClientMsg(req, "Reloaded")
+}
+
// FlushOptions represents the options for the flush call
type FlushOptions struct {
Timeout time.Duration