Skip to content

Commit

Permalink
chore: add time sleep in close http server example
Browse files Browse the repository at this point in the history
  • Loading branch information
appleboy committed Feb 8, 2020
1 parent a5c98cf commit 3a0d22a
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions graceful-shutdown/close/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,15 @@ import (
"net/http"
"os"
"os/signal"
"time"

"github.com/gin-gonic/gin"
)

func main() {
router := gin.Default()
router.GET("/", func(c *gin.Context) {
time.Sleep(5 * time.Second)
c.String(http.StatusOK, "Welcome Gin Server")
})

Expand Down

0 comments on commit 3a0d22a

Please sign in to comment.