您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

manager_unix.go 616B

12345678910111213141516171819202122232425
  1. // Copyright 2020 The Gitea Authors. All rights reserved.
  2. // SPDX-License-Identifier: MIT
  3. //go:build !windows
  4. package private
  5. import (
  6. "net/http"
  7. "code.gitea.io/gitea/modules/context"
  8. "code.gitea.io/gitea/modules/graceful"
  9. )
  10. // Restart causes the server to perform a graceful restart
  11. func Restart(ctx *context.PrivateContext) {
  12. graceful.GetManager().DoGracefulRestart()
  13. ctx.PlainText(http.StatusOK, "success")
  14. }
  15. // Shutdown causes the server to perform a graceful shutdown
  16. func Shutdown(ctx *context.PrivateContext) {
  17. graceful.GetManager().DoGracefulShutdown()
  18. ctx.PlainText(http.StatusOK, "success")
  19. }