Fix comments for historical block processing checks

This commit is contained in:
Nabarun 2024-06-20 10:03:22 +05:30
parent 934bebcd38
commit f2a2901d65

View File

@ -125,11 +125,11 @@ export class EventWatcher {
// Perform checks before starting historical block processing // Perform checks before starting historical block processing
if ( if (
// Check if any block handler exists in subgraph config // Skip historical block processing if any block handler exists
!this._indexer.graphWatcher?.blockHandlerExists && !this._indexer.graphWatcher?.blockHandlerExists &&
// Check if useBlockRanges is enabled for historical blocks processing // Run historical block processing if useBlockRanges is enabled
this._config.jobQueue.useBlockRanges && this._config.jobQueue.useBlockRanges &&
// Check if starting block for watcher is before latest canonical block // Only run historical block processing if we are below the frothy region
startBlockNumber < latestCanonicalBlockNumber startBlockNumber < latestCanonicalBlockNumber
) { ) {
await this.startHistoricalBlockProcessing(startBlockNumber, latestCanonicalBlockNumber); await this.startHistoricalBlockProcessing(startBlockNumber, latestCanonicalBlockNumber);