Skip to content

Commit

Permalink
Merge pull request #35 from samcm/fix/metrics-resub-pre-genesis
Browse files Browse the repository at this point in the history
fix(consensus): No-op event resub if we are pre-genesis
  • Loading branch information
samcm committed Jul 12, 2022
2 parents af18b3d + 18c2ec9 commit 6b2916e
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions pkg/exporter/consensus/beacon/subscriptions.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,15 @@ func (n *node) ensureBeaconSubscription(ctx context.Context) error {
continue
}

// Don't resubscribe if we are pre-genesis.
if n.genesis == nil {
continue
}

if !time.Now().After(n.genesis.GenesisTime) {
continue
}

n.log.
WithField("last_event_time", n.lastEventTime.Local().String()).
Info("Haven't received any events for 5 minutes, re-subscribing")
Expand Down

0 comments on commit 6b2916e

Please sign in to comment.