mirror of
https://github.com/cerc-io/watcher-ts
synced 2025-07-28 11:02:07 +00:00
Check for blockHandlerExists first before block processing
This commit is contained in:
parent
817b5eb359
commit
934bebcd38
@ -125,12 +125,12 @@ export class EventWatcher {
|
||||
|
||||
// Perform checks before starting historical block processing
|
||||
if (
|
||||
// Check if any block handler exists in subgraph config
|
||||
!this._indexer.graphWatcher?.blockHandlerExists &&
|
||||
// Check if useBlockRanges is enabled for historical blocks processing
|
||||
this._config.jobQueue.useBlockRanges &&
|
||||
// Check if starting block for watcher is before latest canonical block
|
||||
startBlockNumber < latestCanonicalBlockNumber &&
|
||||
// Check if any block handler exists in subgraph config
|
||||
!this._indexer.graphWatcher?.blockHandlerExists
|
||||
startBlockNumber < latestCanonicalBlockNumber
|
||||
) {
|
||||
await this.startHistoricalBlockProcessing(startBlockNumber, latestCanonicalBlockNumber);
|
||||
|
||||
|
@ -289,6 +289,7 @@ export interface GraphDatabaseInterface {
|
||||
|
||||
export interface GraphWatcherInterface {
|
||||
readonly blockHandlerExists: boolean;
|
||||
readonly eventHandlerExists: boolean;
|
||||
init (): Promise<void>;
|
||||
setIndexer (indexer: IndexerInterface): void;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user