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 (
|
||||
"compress/gzip"
|
||||
"context"
|
||||
"errors"
|
||||
"fmt"
|
||||
"io"
|
||||
"net"
|
||||
|
|
@ -171,7 +172,7 @@ func (h *httpServer) start() error {
|
|||
}
|
||||
// Log http endpoint.
|
||||
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,
|
||||
"cors", strings.Join(h.httpConfig.CorsAllowedOrigins, ","),
|
||||
"vhosts", strings.Join(h.httpConfig.Vhosts, ","),
|
||||
|
|
@ -279,8 +280,8 @@ func (h *httpServer) doStop() {
|
|||
ctx, cancel := context.WithTimeout(context.Background(), shutdownTimeout)
|
||||
defer cancel()
|
||||
err := h.server.Shutdown(ctx)
|
||||
if err != nil && err == ctx.Err() {
|
||||
h.log.Warn("HTTP server graceful shutdown timed out")
|
||||
if err != nil && errors.Is(err, ctx.Err()) {
|
||||
h.log.Warn("HTTP server graceful shutdown timed out", "err", err)
|
||||
h.server.Close()
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue