fix: reduce import concurrency to prevent 100% CPU during SWF→Nitro conversion
- 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:
1 parent
c043af318b
commit
c2e61dc324
3 files changed
+7
-3
No files matched your search
@@ -39,7 +39,7 @@ export const POST = withAdmin(
|
||||
async (request) => {
|
||||
const body = await request.json();
|
||||
const items: RegenItem[] = body.items || [];
|
||||
const concurrency = Math.min(Math.max(body.concurrency || 3, 1), 5);
|
||||
const concurrency = Math.min(Math.max(body.concurrency || 1, 1), 3);
|
||||
|
||||
if (items.length === 0) return apiError("No items to regenerate", 400);
|
||||
|
||||
@@ -237,6 +237,7 @@ export const POST = withAdmin(
|
||||
});
|
||||
|
||||
await Promise.allSettled(promises);
|
||||
await new Promise((r) => setImmediate(r));
|
||||
}
|
||||
|
||||
// Batch write FurnitureData.json
|
||||
|
||||
Reference in new issue
Block a user