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.
This commit is contained in:
parent
922c83eea3
commit
3588edbb08
5 changed files with 50 additions and 3 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue