Skip to content

Commit

Permalink
feat: keep re-retrying getting the latest block if it fails instead o…
Browse files Browse the repository at this point in the history
…f crashing the indexer
  • Loading branch information
dhvanipa committed Mar 31, 2024
1 parent 6c87714 commit dd1efcc
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions packages/store-sync/src/createStoreSync.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ import {
combineLatest,
scan,
identity,
retry,
} from "rxjs";
import { debug as parentDebug } from "./debug";
import { SyncStep } from "./SyncStep";
Expand Down Expand Up @@ -184,6 +185,10 @@ export async function createStoreSync<config extends StoreConfig = StoreConfig>(
tap((blockNumber) => {
debug("on block number", blockNumber, "for", followBlockTag, "block tag");
}),
retry({
count: undefined, // ie unlimited
delay: 3000, // poll the RPC every 3 seconds
}),
shareReplay(1),
);

Expand Down

0 comments on commit dd1efcc

Please sign in to comment.