Skip to content

Commit

Permalink
Refactor blockProcessingOffset check to switch endpoint on max new bl…
Browse files Browse the repository at this point in the history
…ock retries
  • Loading branch information
nikugogoi committed Aug 5, 2024
1 parent a2ff511 commit 7397ea4
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions packages/util/src/events.ts
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,12 @@ export class EventWatcher {
endBlockNumber = Math.floor(endBlockNumber / this._config.jobQueue.historicalLogsBlockRangeEndFactor) * this._config.jobQueue.historicalLogsBlockRangeEndFactor;
}

if (endBlockNumber < startBlockNumber) {
await this.startRealtimeBlockProcessing(startBlockNumber);

return;
}

this._historicalProcessingEndBlockNumber = endBlockNumber;
log(`Starting historical block processing in batches from ${startBlockNumber} up to block ${this._historicalProcessingEndBlockNumber}`);

Expand Down

0 comments on commit 7397ea4

Please sign in to comment.