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