Skip to content

Commit 39e7a87

Browse files
committed
fix(close-download): small files race conditions
1 parent 6215e24 commit 39e7a87

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/download/download-engine/download-file/download-engine-file.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -409,9 +409,9 @@ export default class DownloadEngineFile extends EventEmitter<DownloadEngineFileE
409409
}
410410
this._closed = true;
411411
this._activeProgram?.abort();
412-
await this.options.onCloseAsync?.();
413412
await this.options.writeStream.close();
414413
await this.options.fetchStream.close();
414+
await this.options.onCloseAsync?.();
415415
this.emit("closed");
416416
}
417417

0 commit comments

Comments
 (0)