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.

28 lines
681 B

  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. }