From 95561481a140685d27e68c0c4e03d879882354f4 Mon Sep 17 00:00:00 2001 From: Rafael Cardenas Date: Sat, 11 Nov 2023 19:02:48 -0600 Subject: [PATCH] fix: reduce chunk size to 3000 --- 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 0f095a30..fc9a2821 100644 --- a/src/pg/pg-store.ts +++ b/src/pg/pg-store.ts @@ -253,9 +253,9 @@ export class PgStore extends BasePgStore { currentBlockHeight: currentBlockHeight, newBlockHeight: block_height, }); - // Divide insertion array into chunks of 4000 in order to avoid the postgres limit of 65534 + // Divide insertion array into chunks of 3000 in order to avoid the postgres limit of 65534 // query params. - for (const writeChunk of chunkArray(writes, 4000)) + for (const writeChunk of chunkArray(writes, 3000)) await this.insertInscriptions(writeChunk); updatedBlockHeightMin = Math.min(updatedBlockHeightMin, event.block_identifier.index); if (ENV.BRC20_BLOCK_SCAN_ENABLED)