Du kan inte välja fler än 25 ämnen Ämnen måste starta med en bokstav eller siffra, kan innehålla bindestreck ('-') och vara max 35 tecken långa.

manager_unix.go 681B

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 causes the server to perform a graceful restart
  12. func Restart(ctx *macaron.Context) {
  13. graceful.GetManager().DoGracefulRestart()
  14. ctx.PlainText(http.StatusOK, []byte("success"))
  15. }
  16. // Shutdown causes the server to perform a graceful shutdown
  17. func Shutdown(ctx *macaron.Context) {
  18. graceful.GetManager().DoGracefulShutdown()
  19. ctx.PlainText(http.StatusOK, []byte("success"))
  20. }