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

1234567891011121314151617181920212223242526
  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. package private
  6. import (
  7. "net/http"
  8. "code.gitea.io/gitea/modules/context"
  9. "code.gitea.io/gitea/modules/graceful"
  10. )
  11. // Restart causes the server to perform a graceful restart
  12. func Restart(ctx *context.PrivateContext) {
  13. graceful.GetManager().DoGracefulRestart()
  14. ctx.PlainText(http.StatusOK, "success")
  15. }
  16. // Shutdown causes the server to perform a graceful shutdown
  17. func Shutdown(ctx *context.PrivateContext) {
  18. graceful.GetManager().DoGracefulShutdown()
  19. ctx.PlainText(http.StatusOK, "success")
  20. }