File tree Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Original file line number Diff line number Diff line change @@ -1793,8 +1793,8 @@ func main() {
1793
1793
// Initializing the server in a goroutine so that
1794
1794
// it won't block the graceful shutdown handling below
1795
1795
go func () {
1796
- if err := srv.ListenAndServe (); err != nil && err != http.ErrServerClosed {
1797
- log.Fatalf (" listen: %s \n " , err)
1796
+ if err := srv.ListenAndServe (); err != nil && errors. Is ( err, http.ErrServerClosed ) {
1797
+ log.Printf (" listen: %s \n " , err)
1798
1798
}
1799
1799
}()
1800
1800
@@ -1812,6 +1812,7 @@ func main() {
1812
1812
// the request it is currently handling
1813
1813
ctx , cancel := context.WithTimeout (context.Background (), 5 *time.Second )
1814
1814
defer cancel ()
1815
+
1815
1816
if err := srv.Shutdown (ctx); err != nil {
1816
1817
log.Fatal (" Server forced to shutdown:" , err)
1817
1818
}
You can’t perform that action at this time.
0 commit comments