fix promise.All location
This commit is contained in:
parent
31b7e62983
commit
4ad7892eab
1 changed files with 2 additions and 3 deletions
|
|
@ -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);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue