Files

28 lines
739 B
Go
Raw Permalink Normal View History

// Copyright 2020 The Gitea Authors. All rights reserved.
// SPDX-License-Identifier: MIT
2021-08-24 11:47:09 -05:00
//go:build windows
package private
import (
"net/http"
"code.gitea.io/gitea/modules/graceful"
"code.gitea.io/gitea/modules/private"
"code.gitea.io/gitea/services/context"
)
// Restart is not implemented for Windows based servers as they can't fork
2021-01-26 23:36:53 +08:00
func Restart(ctx *context.PrivateContext) {
ctx.JSON(http.StatusNotImplemented, private.Response{
UserMsg: "windows servers cannot be gracefully restarted - shutdown and restart manually",
})
}
// Shutdown causes the server to perform a graceful shutdown
2021-01-26 23:36:53 +08:00
func Shutdown(ctx *context.PrivateContext) {
graceful.GetManager().DoGracefulShutdown()
2021-12-15 14:59:57 +08:00
ctx.PlainText(http.StatusOK, "success")
}