fix promise.All location

This commit is contained in:
Maxime 2025-06-25 14:52:58 +02:00
parent 31b7e62983
commit 4ad7892eab

View file

@ -131,8 +131,8 @@ export async function handleConvert(
for (const chunk of chunks(fileNames, MAX_CONVERT_PROCESS)) { for (const chunk of chunks(fileNames, MAX_CONVERT_PROCESS)) {
for(const fileName of chunk) {
const toProcess: Promise<string>[] = []; const toProcess: Promise<string>[] = [];
for(const fileName of chunk) {
const filePath = `${userUploadsDir}${fileName}`; const filePath = `${userUploadsDir}${fileName}`;
const fileTypeOrig = fileName.split(".").pop() ?? ""; const fileTypeOrig = fileName.split(".").pop() ?? "";
const fileType = normalizeFiletype(fileTypeOrig); const fileType = normalizeFiletype(fileTypeOrig);
@ -159,9 +159,8 @@ export async function handleConvert(
}).catch(c => reject(c)); }).catch(c => reject(c));
}) })
); );
await Promise.all(toProcess);
} }
await Promise.all(toProcess);
} }
} }