summaryrefslogtreecommitdiffstats
path: root/routers/private/manager_windows.go
blob: ac840a9d81ce8e2c032114a9de1dca45b0b644f5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
// +build windows

// Copyright 2020 The Gitea Authors. All rights reserved.
// Use of this source code is governed by a MIT-style
// license that can be found in the LICENSE file.

package private

import (
	"net/http"

	"code.gitea.io/gitea/modules/graceful"

	"gitea.com/macaron/macaron"
)

// Restart is not implemented for Windows based servers as they can't fork
func Restart(ctx *macaron.Context) {
	ctx.JSON(http.StatusNotImplemented, map[string]interface{}{
		"err": "windows servers cannot be gracefully restarted - shutdown and restart manually",
	})
}

// Shutdown causes the server to perform a graceful shutdown
func Shutdown(ctx *macaron.Context) {
	graceful.GetManager().DoGracefulShutdown()
	ctx.PlainText(http.StatusOK, []byte("success"))
}