Skip to content

Commit 4ad7892

Browse files
author
Maxime
committed
fix promise.All location
1 parent 31b7e62 commit 4ad7892

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

src/converters/main.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -131,8 +131,8 @@ export async function handleConvert(
131131

132132

133133
for (const chunk of chunks(fileNames, MAX_CONVERT_PROCESS)) {
134+
const toProcess: Promise<string>[] = [];
134135
for(const fileName of chunk) {
135-
const toProcess: Promise<string>[] = [];
136136
const filePath = `${userUploadsDir}${fileName}`;
137137
const fileTypeOrig = fileName.split(".").pop() ?? "";
138138
const fileType = normalizeFiletype(fileTypeOrig);
@@ -159,9 +159,8 @@ export async function handleConvert(
159159
}).catch(c => reject(c));
160160
})
161161
);
162-
163-
await Promise.all(toProcess);
164162
}
163+
await Promise.all(toProcess);
165164
}
166165
}
167166

0 commit comments

Comments
 (0)