mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-06-24 15:44:32 +00:00
parent
5199446cb6
commit
acc9371b8b
1 changed files with 3 additions and 1 deletions
|
|
@ -276,13 +276,15 @@ func (h *httpServer) doStop() {
|
|||
h.wsHandler.Store((*rpcHandler)(nil))
|
||||
wsHandler.server.Stop()
|
||||
}
|
||||
|
||||
ctx, cancel := context.WithTimeout(context.Background(), shutdownTimeout)
|
||||
defer cancel()
|
||||
err := h.server.Shutdown(ctx)
|
||||
if err == ctx.Err() {
|
||||
if err != nil && err == ctx.Err() {
|
||||
h.log.Warn("HTTP server graceful shutdown timed out")
|
||||
h.server.Close()
|
||||
}
|
||||
|
||||
h.listener.Close()
|
||||
h.log.Info("HTTP server stopped", "endpoint", h.listener.Addr())
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue