fix: reduce import concurrency to prevent 100% CPU during SWF→Nitro conversion
CI / check (push) Successful in 42s
CI / release (push) Skipped
CI / deploy (push) Successful in 1m43s

- Default batch concurrency: 3→1 (max 5→3)
- Default batch-regen concurrency: 3→1 (max 5→3)
- Default IMPORT_BATCH_CONCURRENCY: 12→3
- Added setImmediate yields between items to prevent event loop blocking

Fixes gatje and other complex furniture imports consuming 100% CPU and stalling the catalog studio.
This commit is contained in:
openhands committed 2026-08-23 19:51:04 +02:00
1 parent c043af318b
commit c2e61dc324
3 files changed
+7 -3

No files matched your search

@@ -42,7 +42,7 @@ export const POST = withAdmin(
async (request, ctx) => {
const body = await request.json();
const rawItems: BatchItem[] = body.items || [];
const concurrency = Math.min(Math.max(body.concurrency || 3, 1), 5);
const concurrency = Math.min(Math.max(body.concurrency || 1, 1), 3);
const sourceId: string | undefined = body.sourceId;
if (rawItems.length === 0) return apiError("No items to import", 400);
@@ -179,6 +179,7 @@ export const POST = withAdmin(
});
await Promise.allSettled(promises);
await new Promise((r) => setImmediate(r));
}
// Batch write FurnitureData.json once at the end — BEFORE RCON so the