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 724B

12345678910111213141516171819202122232425262728
  1. // Copyright 2020 The Gitea Authors. All rights reserved.
  2. // Use of this source code is governed by a MIT-style
  3. // license that can be found in the LICENSE file.
  4. //go:build !windows
  5. // +build !windows
  6. package private
  7. import (
  8. "net/http"
  9. "code.gitea.io/gitea/modules/context"
  10. "code.gitea.io/gitea/modules/graceful"
  11. )
  12. // Restart causes the server to perform a graceful restart
  13. func Restart(ctx *context.PrivateContext) {
  14. graceful.GetManager().DoGracefulRestart()
  15. ctx.PlainText(http.StatusOK, []byte("success"))
  16. }
  17. // Shutdown causes the server to perform a graceful shutdown
  18. func Shutdown(ctx *context.PrivateContext) {
  19. graceful.GetManager().DoGracefulShutdown()
  20. ctx.PlainText(http.StatusOK, []byte("success"))
  21. }