You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

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. }