code.gitea.io/gitea@v1.21.7/routers/private/manager_windows.go (about)

     1  // Copyright 2020 The Gitea Authors. All rights reserved.
     2  // SPDX-License-Identifier: MIT
     3  
     4  //go:build windows
     5  
     6  package private
     7  
     8  import (
     9  	"net/http"
    10  
    11  	"code.gitea.io/gitea/modules/context"
    12  	"code.gitea.io/gitea/modules/graceful"
    13  	"code.gitea.io/gitea/modules/private"
    14  )
    15  
    16  // Restart is not implemented for Windows based servers as they can't fork
    17  func Restart(ctx *context.PrivateContext) {
    18  	ctx.JSON(http.StatusNotImplemented, private.Response{
    19  		UserMsg: "windows servers cannot be gracefully restarted - shutdown and restart manually",
    20  	})
    21  }
    22  
    23  // Shutdown causes the server to perform a graceful shutdown
    24  func Shutdown(ctx *context.PrivateContext) {
    25  	graceful.GetManager().DoGracefulShutdown()
    26  	ctx.PlainText(http.StatusOK, "success")
    27  }