diff --git a/scripts/transfer-enriched-to-neon.ts b/scripts/transfer-enriched-to-neon.ts index 0acc570..70668b1 100644 --- a/scripts/transfer-enriched-to-neon.ts +++ b/scripts/transfer-enriched-to-neon.ts @@ -113,7 +113,7 @@ async function main() { console.log(`šŸ”„ Incremental filter: updatedAt > ${transferSince.toISOString()}\n`); } - const BATCH_SIZE = 200; + const BATCH_SIZE = 100; const totalCount = await nasPrisma.church.count({ where: whereClause }); console.log(`Found ${totalCount} enriched churches (will process in batches of ${BATCH_SIZE})\n`); @@ -270,6 +270,9 @@ async function main() { console.error(`Error transferring ${church.name}:`, error instanceof Error ? error.message : error); } } + + // Brief pause between batches to avoid overwhelming Neon + await new Promise(resolve => setTimeout(resolve, 1000)); } // end batch loop console.log('\n════════════════════════════════════════════════════════════');