mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-20 10:52:25 +00:00
Recover lost HTTP server lifecycle log messages
This commit is contained in:
parent
bae9069f98
commit
45e2022079
1 changed files with 3 additions and 1 deletions
|
|
@ -407,6 +407,7 @@ func (n *Node) stopHTTP() {
|
||||||
if n.httpServer != nil {
|
if n.httpServer != nil {
|
||||||
// Don't bother imposing a timeout here.
|
// Don't bother imposing a timeout here.
|
||||||
n.httpServer.Shutdown(context.Background())
|
n.httpServer.Shutdown(context.Background())
|
||||||
|
n.log.Info("HTTP endpoint closed", "url", fmt.Sprintf("http://%v/", n.httpListenerAddr))
|
||||||
}
|
}
|
||||||
if n.httpHandler != nil {
|
if n.httpHandler != nil {
|
||||||
n.httpHandler.Stop()
|
n.httpHandler.Stop()
|
||||||
|
|
@ -431,7 +432,7 @@ func (n *Node) startWS(endpoint string, apis []rpc.API, modules []string, wsOrig
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
n.log.Info("WebSocket endpoint opened", "url", fmt.Sprintf("ws://%s", addr))
|
n.log.Info("WebSocket endpoint opened", "url", fmt.Sprintf("ws://%v", addr))
|
||||||
// All listeners booted successfully
|
// All listeners booted successfully
|
||||||
n.wsEndpoint = endpoint
|
n.wsEndpoint = endpoint
|
||||||
n.wsListenerAddr = addr
|
n.wsListenerAddr = addr
|
||||||
|
|
@ -446,6 +447,7 @@ func (n *Node) stopWS() {
|
||||||
if n.wsHTTPServer != nil {
|
if n.wsHTTPServer != nil {
|
||||||
// Don't bother imposing a timeout here.
|
// Don't bother imposing a timeout here.
|
||||||
n.wsHTTPServer.Shutdown(context.Background())
|
n.wsHTTPServer.Shutdown(context.Background())
|
||||||
|
n.log.Info("WebSocket endpoint closed", "url", fmt.Sprintf("ws://%v", n.wsListenerAddr))
|
||||||
}
|
}
|
||||||
if n.wsHandler != nil {
|
if n.wsHandler != nil {
|
||||||
n.wsHandler.Stop()
|
n.wsHandler.Stop()
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue