@@ -41,6 +41,7 @@ import {
41
41
42
42
export const MIGRATIONS_DIR = path . join ( __dirname , '../../migrations' ) ;
43
43
export const ORDINALS_GENESIS_BLOCK = 767430 ;
44
+ const INSERT_BATCH_SIZE = 4000 ;
44
45
45
46
type InscriptionIdentifier = { genesis_id : string } | { number : number } ;
46
47
@@ -133,7 +134,7 @@ export class PgStore extends BasePgStore {
133
134
currentBlockHeight : currentBlockHeight ,
134
135
newBlockHeight : event . block_identifier . index ,
135
136
} ) ;
136
- for ( const writeChunk of batchIterate ( writes , 4000 ) )
137
+ for ( const writeChunk of batchIterate ( writes , INSERT_BATCH_SIZE ) )
137
138
await this . insertInscriptions ( writeChunk ) ;
138
139
updatedBlockHeightMin = Math . min ( updatedBlockHeightMin , event . block_identifier . index ) ;
139
140
logger . info (
@@ -548,7 +549,7 @@ export class PgStore extends BasePgStore {
548
549
updated_at = NOW()
549
550
` ;
550
551
const pointers : DbLocationPointerInsert [ ] = [ ] ;
551
- for ( const batch of batchIterate ( locationInserts , 8000 ) )
552
+ for ( const batch of batchIterate ( locationInserts , INSERT_BATCH_SIZE ) )
552
553
pointers . push (
553
554
...( await sql < DbLocationPointerInsert [ ] > `
554
555
INSERT INTO locations ${ sql ( batch ) }
@@ -571,7 +572,7 @@ export class PgStore extends BasePgStore {
571
572
SET updated_at = NOW()
572
573
WHERE sat_ordinal IN ${ sql ( transferredOrdinalNumbers ) }
573
574
` ;
574
- for ( const batch of batchIterate ( pointers , 8000 ) )
575
+ for ( const batch of batchIterate ( pointers , INSERT_BATCH_SIZE ) )
575
576
await this . updateInscriptionLocationPointers ( batch ) ;
576
577
for ( const reveal of reveals ) {
577
578
const action =
0 commit comments