mirror of
https://github.com/gin-gonic/gin.git
synced 2025-10-22 17:42:14 +08:00
Update server.go
This commit is contained in:
parent
d3c6fecb57
commit
71ef1798c6
@ -1,4 +1,4 @@
|
||||
// +build go1.8
|
||||
// +build go1.11
|
||||
|
||||
package main
|
||||
|
||||
@ -44,9 +44,10 @@ func main() {
|
||||
if err := srv.Shutdown(ctx); err != nil {
|
||||
log.Fatal("Server Shutdown:", err)
|
||||
}
|
||||
// catching ctx.Done(). timeout of 5 seconds.
|
||||
// catching ctx.Done(). timeout of 5 seconds.
|
||||
select {
|
||||
case <-ctx.Done():
|
||||
log.Println("timeout of 5 seconds.")
|
||||
}
|
||||
log.Println("Server exiting")
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user