mirror of
https://github.com/sot-tech/mochi.git
synced 2026-06-21 03:38:26 -07:00
Silence net.OpErrors dealing with accept.
This code is borrowed from: https://github.com/stretchr/graceful/blob/6e11439113e0d071338d6be3f10d7772817faf59/graceful.go#L52-L58
This commit is contained in:
+3
-1
@@ -128,7 +128,9 @@ func Serve(cfg *config.Config, tkr *tracker.Tracker) {
|
||||
}
|
||||
|
||||
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 {
|
||||
|
||||
Reference in New Issue
Block a user