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

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. package private
  6. import (
  7. "net/http"
  8. "code.gitea.io/gitea/modules/context"
  9. "code.gitea.io/gitea/modules/graceful"
  10. "code.gitea.io/gitea/modules/private"
  11. )
  12. // Restart is not implemented for Windows based servers as they can't fork
  13. func Restart(ctx *context.PrivateContext) {
  14. ctx.JSON(http.StatusNotImplemented, private.Response{
  15. Err: "windows servers cannot be gracefully restarted - shutdown and restart manually",
  16. })
  17. }
  18. // Shutdown causes the server to perform a graceful shutdown
  19. func Shutdown(ctx *context.PrivateContext) {
  20. graceful.GetManager().DoGracefulShutdown()
  21. ctx.PlainText(http.StatusOK, "success")
  22. }