From ebd4848827a05fe07c9ea36da129aa7350a3efa8 Mon Sep 17 00:00:00 2001 From: silvertakana Date: Thu, 5 Mar 2026 11:29:54 +1300 Subject: [PATCH] fix(api): Reduce Supabase chunk size to prevent fetch timeouts --- src/app/api/aviation/route.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/app/api/aviation/route.ts b/src/app/api/aviation/route.ts index 4a1fc19f..72759004 100644 --- a/src/app/api/aviation/route.ts +++ b/src/app/api/aviation/route.ts @@ -240,7 +240,7 @@ async function recordToSupabase(states: any[], timeSecs: number) { // Supabase allows bulk inserts, but a single payload with 5000+ planes can hit PostgREST limits (400 Bad Request) // We chunk the inserts into smaller batches. - const CHUNK_SIZE = 2000; + const CHUNK_SIZE = 500; let successCount = 0; for (let i = 0; i < records.length; i += CHUNK_SIZE) {