Skip to content

Commit

Permalink
feat: log node connects
Browse files Browse the repository at this point in the history
  • Loading branch information
freak12techno committed Jul 18, 2023
1 parent c5f3036 commit ba84cd7
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion pkg/tendermint/ws/websocket_client.go
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ func (t *TendermintWebsocketClient) Listen() {
t.Logger.Error().Err(err).Msg("Failed to create a client")
t.Error = err
t.Channel <- t.MakeReport(&types.NodeConnectError{Error: err, URL: t.URL, Chain: t.Chain.GetName()})
t.MetricsManager.LogNodeReconnect(t.Chain.Name, t.URL)
t.MetricsManager.LogNodeConnection(t.Chain.Name, t.URL, false)
return
}

Expand All @@ -108,9 +108,11 @@ func (t *TendermintWebsocketClient) Listen() {
t.Error = err
t.Channel <- t.MakeReport(&types.NodeConnectError{Error: err, URL: t.URL, Chain: t.Chain.GetName()})
t.Logger.Warn().Err(err).Msg("Error connecting to node")
t.MetricsManager.LogNodeConnection(t.Chain.Name, t.URL, false)
} else {
t.Logger.Debug().Msg("Connected to a node")
t.Active = true
t.MetricsManager.LogNodeConnection(t.Chain.Name, t.URL, true)
}

t.SubscribeToUpdates()
Expand Down

0 comments on commit ba84cd7

Please sign in to comment.