From 8fd770bc4e83be6ddaa4fdead1d1be55c42f870b Mon Sep 17 00:00:00 2001 From: Rafael Cardenas Date: Thu, 2 Nov 2023 15:19:47 -0600 Subject: [PATCH] fix: reduce batching to 4500 --- src/pg/pg-store.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/pg/pg-store.ts b/src/pg/pg-store.ts index 70365cc1..59b08b5b 100644 --- a/src/pg/pg-store.ts +++ b/src/pg/pg-store.ts @@ -251,9 +251,9 @@ export class PgStore extends BasePgStore { } } } - // Divide insertion array into chunks of 5000 in order to avoid the postgres limit of 65534 + // Divide insertion array into chunks of 4500 in order to avoid the postgres limit of 65534 // query params. - for (const writeChunk of chunkArray(writes, 5000)) + for (const writeChunk of chunkArray(writes, 4500)) await this.insertInscriptions(writeChunk); updatedBlockHeightMin = Math.min(updatedBlockHeightMin, event.block_identifier.index); if (ENV.BRC20_BLOCK_SCAN_ENABLED)