Skip to content

Commit

Permalink
fix: file stream delay
Browse files Browse the repository at this point in the history
  • Loading branch information
czy88840616 committed Sep 21, 2024
1 parent 60a5349 commit b5ad9be
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions packages/busboy/src/middleware.ts
Original file line number Diff line number Diff line change
Expand Up @@ -273,6 +273,7 @@ export class UploadMiddleware implements IMiddleware<any, any> {

bb.on('close', async () => {
this.logger.debug('[busboy]: busboy close');
// close 事件会在 busboy 解析完所有数据后触发,但是这个时候有可能没有写完文件,所以使用 Promise.all 等待所有文件写入完成
resolveP({
fields,
files: await Promise.all(files),
Expand Down

0 comments on commit b5ad9be

Please sign in to comment.