Silence net.OpErrors dealing with accept.

This code is borrowed from:
6e11439113/graceful.go (L52-L58)
This commit is contained in:
Jimmy Zelinskie 2014-08-05 15:00:52 -04:00
parent fc18028796
commit e3420b4013

View file

@ -128,7 +128,9 @@ func Serve(cfg *config.Config, tkr *tracker.Tracker) {
} }
if err := grace.ListenAndServe(); err != nil { if err := grace.ListenAndServe(); err != nil {
glog.Errorf("Failed to start server: %s", err.Error()) if opErr, ok := err.(*net.OpError); !ok || (ok && opErr.Op != "accept") {
glog.Errorf("Failed to gracefully run HTTP server: %s", err.Error())
}
} }
if err := srv.tracker.Close(); err != nil { if err := srv.tracker.Close(); err != nil {