mirror of
https://github.com/cerc-io/watcher-ts
synced 2025-01-22 02:59:06 +00:00
Refactor blockProcessingOffset check to switch endpoint on max new block retries
This commit is contained in:
parent
3cd6491305
commit
e1abd5f684
@ -158,6 +158,12 @@ export class EventWatcher {
|
|||||||
endBlockNumber = Math.floor(endBlockNumber / this._config.jobQueue.historicalLogsBlockRangeEndFactor) * this._config.jobQueue.historicalLogsBlockRangeEndFactor;
|
endBlockNumber = Math.floor(endBlockNumber / this._config.jobQueue.historicalLogsBlockRangeEndFactor) * this._config.jobQueue.historicalLogsBlockRangeEndFactor;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (endBlockNumber < startBlockNumber) {
|
||||||
|
await this.startRealtimeBlockProcessing(startBlockNumber);
|
||||||
|
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
this._historicalProcessingEndBlockNumber = endBlockNumber;
|
this._historicalProcessingEndBlockNumber = endBlockNumber;
|
||||||
log(`Starting historical block processing in batches from ${startBlockNumber} up to block ${this._historicalProcessingEndBlockNumber}`);
|
log(`Starting historical block processing in batches from ${startBlockNumber} up to block ${this._historicalProcessingEndBlockNumber}`);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user