Skip to content

Commit

Permalink
add chain id to alert string
Browse files Browse the repository at this point in the history
  • Loading branch information
pkieltyka committed Apr 18, 2024
1 parent 9b98f8c commit d996860
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions ethmonitor/ethmonitor.go
Original file line number Diff line number Diff line change
Expand Up @@ -326,8 +326,8 @@ func (m *Monitor) listenNewHead() <-chan uint64 {
newHeads := make(chan *types.Header)
sub, err := m.provider.SubscribeNewHeads(m.ctx, newHeads)
if err != nil {
m.log.Warnf("ethmonitor: websocket connect failed: %v", err)
m.alert.Alert(context.Background(), "ethmonitor: websocket connect failed: %v", err)
m.log.Warnf("ethmonitor (chain %s): websocket connect failed: %v", m.chainID.String(), err)
m.alert.Alert(context.Background(), "ethmonitor (chain %s): websocket connect failed: %v", m.chainID.String(), err)
time.Sleep(2000 * time.Millisecond)

streamingErrorLastTime = time.Now()
Expand All @@ -347,8 +347,8 @@ func (m *Monitor) listenNewHead() <-chan uint64 {

case err := <-sub.Err():
// if we have an error, we'll reconnect
m.log.Warnf("ethmonitor: websocket subscription error: %v", err)
m.alert.Alert(context.Background(), "ethmonitor: websocket subscription error: %v", err)
m.log.Warnf("ethmonitor (chain %s): websocket subscription error: %v", m.chainID.String(), err)
m.alert.Alert(context.Background(), "ethmonitor (chain %s): websocket subscription error: %v", m.chainID.String(), err)
sub.Unsubscribe()

streamingErrorLastTime = time.Now()
Expand Down

0 comments on commit d996860

Please sign in to comment.