Skip to content

Commit

Permalink
Remove duplicate default poll interval
Browse files Browse the repository at this point in the history
  • Loading branch information
vegarsti committed Jul 1, 2024
1 parent 23719b9 commit 733b353
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 6 deletions.
2 changes: 1 addition & 1 deletion client/jsonrpc/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ func NewClient(log *slog.Logger, cfg Config) (*rpcClient, error) { // revive:dis
},
httpHeaders: cfg.HTTPHeaders,
}
// lets validate RPC node is up & reachable
// Ensure RPC node is up & reachable
_, err := rpc.LatestBlockNumber()
if err != nil {
return nil, fmt.Errorf("failed to connect to jsonrpc: %w", err)
Expand Down
4 changes: 0 additions & 4 deletions ingester/ingester.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ type Ingester interface {

const (
defaultMaxBatchSize = 5
defaultPollInterval = 1 * time.Second
defaultReportProgressInterval = 30 * time.Second
)

Expand Down Expand Up @@ -119,9 +118,6 @@ func New(
cfg: cfg,
info: info,
}
if ing.cfg.PollInterval == 0 {
ing.cfg.PollInterval = defaultPollInterval
}
if ing.cfg.ReportProgressInterval == 0 {
ing.cfg.ReportProgressInterval = defaultReportProgressInterval
}
Expand Down
4 changes: 3 additions & 1 deletion ingester/mainloop.go
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,9 @@ func (i *ingester) ProduceBlockNumbers(
return latestBlockNumber
case <-time.After(i.cfg.PollInterval):
}
i.log.Debug(fmt.Sprintf("Waiting %v for block to be available..", i.cfg.PollInterval),
i.log.Debug(
"Waiting for block to be available",
"waitTime", i.cfg.PollInterval.String(),
"blockNumber", blockNumber,
"latestBlockNumber", latestBlockNumber,
)
Expand Down

0 comments on commit 733b353

Please sign in to comment.