Skip to content

Commit

Permalink
fix: try batch iterator generator
Browse files Browse the repository at this point in the history
  • Loading branch information
rafaelcr committed Nov 12, 2023
1 parent 2037647 commit e2ed039
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/pg/pg-store.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import {
PgConnectionVars,
PgSqlClient,
PgSqlQuery,
batchIterate,
connectPostgres,
logger,
runMigrations,
Expand Down Expand Up @@ -255,7 +256,7 @@ export class PgStore extends BasePgStore {
});
// Divide insertion array into chunks of 3000 in order to avoid the postgres limit of 65534
// query params.
for (const writeChunk of chunkArray(writes, 3000))
for (const writeChunk of batchIterate(writes, 3000))
await this.insertInscriptions(writeChunk);
updatedBlockHeightMin = Math.min(updatedBlockHeightMin, event.block_identifier.index);
if (ENV.BRC20_BLOCK_SCAN_ENABLED)
Expand Down

0 comments on commit e2ed039

Please sign in to comment.