Skip to content

Commit 8633bcb

Browse files
committed
updated throw to log & return
1 parent f5acf08 commit 8633bcb

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

src/worker/tasks/chainIndexer.ts

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import { StaticJsonRpcBatchProvider } from "@thirdweb-dev/sdk";
12
import { getBlockForIndexing } from "../../db/chainIndexers/getChainIndexer";
23
import { upsertChainIndexer } from "../../db/chainIndexers/upsertChainIndexer";
34
import { prisma } from "../../db/client";
@@ -48,7 +49,14 @@ export const createChainIndexerTask = async (args: {
4849
const block = await provider.getBlockWithTransactions(toBlock);
4950

5051
if (!block) {
51-
throw new Error(`Failed to get block: ${toBlock}`);
52+
logger({
53+
service: "worker",
54+
level: "warn",
55+
message: `Block data not available: ${toBlock} on chain: ${chainId}, url: ${
56+
(provider as StaticJsonRpcBatchProvider).connection.url
57+
}. Will retry in the next cycle.`,
58+
});
59+
return;
5260
}
5361

5462
// Get contract addresses to filter event logs and transaction receipts by.

0 commit comments

Comments
 (0)