Skip to content

Commit 3a0d22a

Browse files
committed
chore: add time sleep in close http server example
1 parent a5c98cf commit 3a0d22a

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

graceful-shutdown/close/server.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,15 @@ import (
77
"net/http"
88
"os"
99
"os/signal"
10+
"time"
1011

1112
"github.com/gin-gonic/gin"
1213
)
1314

1415
func main() {
1516
router := gin.Default()
1617
router.GET("/", func(c *gin.Context) {
18+
time.Sleep(5 * time.Second)
1719
c.String(http.StatusOK, "Welcome Gin Server")
1820
})
1921

0 commit comments

Comments
 (0)