forked from mirror/gin
doc(graceful-shutdown): failure to ListenAndServe should be a reason to exit (#1287)
Signed-off-by: Romain Beuque <romain.beuque@gmail.com>
This commit is contained in:
parent
5d3f30cfc8
commit
3e3f9bca81
|
@ -1324,8 +1324,8 @@ func main() {
|
||||||
|
|
||||||
go func() {
|
go func() {
|
||||||
// service connections
|
// service connections
|
||||||
if err := srv.ListenAndServe(); err != nil {
|
if err := srv.ListenAndServe(); err != nil && err != http.ErrServerClosed {
|
||||||
log.Printf("listen: %s\n", err)
|
log.Fatalf("listen: %s\n", err)
|
||||||
}
|
}
|
||||||
}()
|
}()
|
||||||
|
|
||||||
|
|
|
@ -27,8 +27,8 @@ func main() {
|
||||||
|
|
||||||
go func() {
|
go func() {
|
||||||
// service connections
|
// service connections
|
||||||
if err := srv.ListenAndServe(); err != nil {
|
if err := srv.ListenAndServe(); err != nil && err != http.ErrServerClosed {
|
||||||
log.Printf("listen: %s\n", err)
|
log.Fatalf("listen: %s\n", err)
|
||||||
}
|
}
|
||||||
}()
|
}()
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue