Skip to content

Commit

Permalink
#5412: review feedback on loop logic
Browse files Browse the repository at this point in the history
  • Loading branch information
sreuland committed Sep 26, 2024
1 parent 4876f2e commit 94285c0
Showing 1 changed file with 1 addition and 7 deletions.
8 changes: 1 addition & 7 deletions ingest/cdp/producer.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ package cdp
import (
"context"
"fmt"
"math"
"time"

"github.com/prometheus/client_golang/prometheus"
Expand Down Expand Up @@ -130,14 +129,9 @@ func PublishFromBufferedStorageBackend(ledgerRange ledgerbackend.Range,
}

from := ordered.Max(2, ledgerRange.From())
to := ledgerRange.To()
if !ledgerRange.Bounded() {
to = math.MaxUint32
}

ledgerBackend.PrepareRange(ctx, ledgerRange)

for ledgerSeq := from; ledgerSeq <= to; ledgerSeq++ {
for ledgerSeq := from; ledgerSeq <= ledgerRange.To() || !ledgerRange.Bounded(); ledgerSeq++ {
var ledgerCloseMeta xdr.LedgerCloseMeta

logger.WithField("sequence", ledgerSeq).Info("Requesting ledger from the backend...")
Expand Down

0 comments on commit 94285c0

Please sign in to comment.