Silence net.OpErrors dealing with accept.
This code is borrowed from:
6e11439113/graceful.go (L52-L58)
This commit is contained in:
parent
fc18028796
commit
e3420b4013
1 changed files with 3 additions and 1 deletions
|
@ -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 {
|
||||||
|
|
Loading…
Add table
Reference in a new issue