From ed07018b86046fec20786f4752ac98a4175eb5eb Mon Sep 17 00:00:00 2001 From: Kevin Ingersoll Date: Sat, 16 Sep 2023 23:43:25 +0100 Subject: [PATCH] fix(store-indexer): subscribe postgres indexer to stream (#1514) --- .changeset/chilled-kangaroos-dream.md | 5 +++++ packages/store-indexer/bin/postgres-indexer.ts | 2 ++ 2 files changed, 7 insertions(+) create mode 100644 .changeset/chilled-kangaroos-dream.md diff --git a/.changeset/chilled-kangaroos-dream.md b/.changeset/chilled-kangaroos-dream.md new file mode 100644 index 0000000000..a1edaf3719 --- /dev/null +++ b/.changeset/chilled-kangaroos-dream.md @@ -0,0 +1,5 @@ +--- +"@latticexyz/store-indexer": patch +--- + +Fixes postgres indexer stopping sync after it catches up to the latest block. diff --git a/packages/store-indexer/bin/postgres-indexer.ts b/packages/store-indexer/bin/postgres-indexer.ts index 8370b10338..64cc564f24 100644 --- a/packages/store-indexer/bin/postgres-indexer.ts +++ b/packages/store-indexer/bin/postgres-indexer.ts @@ -105,6 +105,8 @@ const { latestBlockNumber$, storedBlockLogs$ } = await createStoreSync({ maxBlockRange: env.MAX_BLOCK_RANGE, }); +storedBlockLogs$.subscribe(); + combineLatest([latestBlockNumber$, storedBlockLogs$]) .pipe( filter(