Fix "Established connection" log message.
Don't log "Established connection" message on new when DisableConnectOnNew is set and no connection was actually established. Do log that same message when Connect() successfully connects.
This commit is contained in:
parent
975536f20f
commit
b81555beea
1 changed files with 4 additions and 2 deletions
|
@ -1211,8 +1211,6 @@ func New(config *ConnConfig, ntfnHandlers *NotificationHandlers) (*Client, error
|
||||||
start = true
|
start = true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
log.Infof("Established connection to RPC server %s",
|
|
||||||
config.Host)
|
|
||||||
|
|
||||||
client := &Client{
|
client := &Client{
|
||||||
config: config,
|
config: config,
|
||||||
|
@ -1230,6 +1228,8 @@ func New(config *ConnConfig, ntfnHandlers *NotificationHandlers) (*Client, error
|
||||||
}
|
}
|
||||||
|
|
||||||
if start {
|
if start {
|
||||||
|
log.Infof("Established connection to RPC server %s",
|
||||||
|
config.Host)
|
||||||
close(connEstablished)
|
close(connEstablished)
|
||||||
client.start()
|
client.start()
|
||||||
if !client.config.HTTPPostMode && !client.config.DisableAutoReconnect {
|
if !client.config.HTTPPostMode && !client.config.DisableAutoReconnect {
|
||||||
|
@ -1282,6 +1282,8 @@ func (c *Client) Connect(tries int) error {
|
||||||
// Connection was established. Set the websocket connection
|
// Connection was established. Set the websocket connection
|
||||||
// member of the client and start the goroutines necessary
|
// member of the client and start the goroutines necessary
|
||||||
// to run the client.
|
// to run the client.
|
||||||
|
log.Infof("Established connection to RPC server %s",
|
||||||
|
c.config.Host)
|
||||||
c.wsConn = wsConn
|
c.wsConn = wsConn
|
||||||
close(c.connEstablished)
|
close(c.connEstablished)
|
||||||
c.start()
|
c.start()
|
||||||
|
|
Loading…
Reference in a new issue