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

12345678910111213141516171819202122232425262728
  1. // +build windows
  2. // Copyright 2020 The Gitea Authors. All rights reserved.
  3. // Use of this source code is governed by a MIT-style
  4. // license that can be found in the LICENSE file.
  5. package private
  6. import (
  7. "net/http"
  8. "code.gitea.io/gitea/modules/graceful"
  9. "gitea.com/macaron/macaron"
  10. )
  11. // Restart is not implemented for Windows based servers as they can't fork
  12. func Restart(ctx *macaron.Context) {
  13. ctx.JSON(http.StatusNotImplemented, map[string]interface{}{
  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 *macaron.Context) {
  19. graceful.GetManager().DoGracefulShutdown()
  20. ctx.PlainText(http.StatusOK, []byte("success"))
  21. }