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_windows.go 734B

123456789101112131415161718192021222324252627
  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. "code.gitea.io/gitea/modules/private"
  10. )
  11. // Restart is not implemented for Windows based servers as they can't fork
  12. func Restart(ctx *context.PrivateContext) {
  13. ctx.JSON(http.StatusNotImplemented, private.Response{
  14. Err: "windows servers cannot be gracefully restarted - shutdown and restart manually",
  15. })
  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, "success")
  21. }