mirror of
https://github.com/fnproject/fn.git
synced 2022-10-28 21:29:17 +03:00
15
api/server/shutdown.go
Normal file
15
api/server/shutdown.go
Normal file
@@ -0,0 +1,15 @@
|
||||
package server
|
||||
|
||||
import (
|
||||
"context"
|
||||
"net/http"
|
||||
|
||||
"github.com/gin-gonic/gin"
|
||||
)
|
||||
|
||||
func (s *Server) handleShutdown(halt context.CancelFunc) func(*gin.Context) {
|
||||
return func(c *gin.Context) {
|
||||
halt()
|
||||
c.JSON(http.StatusOK, "shutting down")
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user