From 4ad7892eabac28643b0c41f4bb625573b08252bd Mon Sep 17 00:00:00 2001 From: Maxime Date: Wed, 25 Jun 2025 14:52:58 +0200 Subject: [PATCH] fix promise.All location --- src/converters/main.ts | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/converters/main.ts b/src/converters/main.ts index 5bdbc78..dddc52d 100644 --- a/src/converters/main.ts +++ b/src/converters/main.ts @@ -131,8 +131,8 @@ export async function handleConvert( for (const chunk of chunks(fileNames, MAX_CONVERT_PROCESS)) { + const toProcess: Promise[] = []; for(const fileName of chunk) { - const toProcess: Promise[] = []; const filePath = `${userUploadsDir}${fileName}`; const fileTypeOrig = fileName.split(".").pop() ?? ""; const fileType = normalizeFiletype(fileTypeOrig); @@ -159,9 +159,8 @@ export async function handleConvert( }).catch(c => reject(c)); }) ); - - await Promise.all(toProcess); } + await Promise.all(toProcess); } }