Skip to content
Myr

doc(graceful-shutdown): failure to ListenAndServe should be a reason to exit (#1287)

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by Romain Beuque · committed by Bo-Yi Wu · parent 5d3f30c · Browse files · 2 files+4 added−4 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Trailers

  • Signed-off-by: Romain Beuque <romain.beuque@gmail.com>

Diff stats

2 files+4 added−4 removed

  • other:+4 added−4 removed

2 files+4 added−4 removed

modified:examples/graceful-shutdown/graceful-shutdown/server.go+2 added-2 removed
25 unmodified lines
26 }2728 go func() {29 // service connections30 if err := srv.ListenAndServe(); err != nil {31 log.Printf("listen: %s\n", err)30 if err := srv.ListenAndServe(); err != nil && err != http.ErrServerClosed {31 log.Fatalf("listen: %s\n", err)32 }33 }()3435 // Wait for interrupt signal to gracefully shutdown the server with
13 unmodified lines
modified:README.md+2 added-2 removed
1322 unmodified lines
1323 }13241325 go func() {1326 // service connections1327 if err := srv.ListenAndServe(); err != nil {1328 log.Printf("listen: %s\n", err)1327 if err := srv.ListenAndServe(); err != nil && err != http.ErrServerClosed {1328 log.Fatalf("listen: %s\n", err)1329 }1330 }()13311332 // Wait for interrupt signal to gracefully shutdown the server with
67 unmodified lines