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