mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-20 10:52:25 +00:00
add err log
This commit is contained in:
parent
82ec555d70
commit
a35a6ba19e
1 changed files with 4 additions and 3 deletions
|
|
@ -19,6 +19,7 @@ package node
|
||||||
import (
|
import (
|
||||||
"compress/gzip"
|
"compress/gzip"
|
||||||
"context"
|
"context"
|
||||||
|
"errors"
|
||||||
"fmt"
|
"fmt"
|
||||||
"io"
|
"io"
|
||||||
"net"
|
"net"
|
||||||
|
|
@ -171,7 +172,7 @@ func (h *httpServer) start() error {
|
||||||
}
|
}
|
||||||
// Log http endpoint.
|
// Log http endpoint.
|
||||||
h.log.Info("HTTP server started",
|
h.log.Info("HTTP server started",
|
||||||
"endpoint", listener.Addr(), "auth", (h.httpConfig.jwtSecret != nil),
|
"endpoint", listener.Addr(), "auth", h.httpConfig.jwtSecret != nil,
|
||||||
"prefix", h.httpConfig.prefix,
|
"prefix", h.httpConfig.prefix,
|
||||||
"cors", strings.Join(h.httpConfig.CorsAllowedOrigins, ","),
|
"cors", strings.Join(h.httpConfig.CorsAllowedOrigins, ","),
|
||||||
"vhosts", strings.Join(h.httpConfig.Vhosts, ","),
|
"vhosts", strings.Join(h.httpConfig.Vhosts, ","),
|
||||||
|
|
@ -279,8 +280,8 @@ func (h *httpServer) doStop() {
|
||||||
ctx, cancel := context.WithTimeout(context.Background(), shutdownTimeout)
|
ctx, cancel := context.WithTimeout(context.Background(), shutdownTimeout)
|
||||||
defer cancel()
|
defer cancel()
|
||||||
err := h.server.Shutdown(ctx)
|
err := h.server.Shutdown(ctx)
|
||||||
if err != nil && err == ctx.Err() {
|
if err != nil && errors.Is(err, ctx.Err()) {
|
||||||
h.log.Warn("HTTP server graceful shutdown timed out")
|
h.log.Warn("HTTP server graceful shutdown timed out", "err", err)
|
||||||
h.server.Close()
|
h.server.Close()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue