Skip to content

Commit

Permalink
fix(nestjs-tools-fastify-upload): fix file stream destruction logic
Browse files Browse the repository at this point in the history
  • Loading branch information
getlarge committed Aug 3, 2024
1 parent fec5dce commit e791752
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion packages/fastify-upload/src/lib/storage/stream-storage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,10 @@ export class StreamStorage extends Storage<StreamStorageFile> {
if (!force) {
await finished(file.stream);
file.stream.destroy();
return;
}
if (!file.stream.destroyed) {
file.stream.destroy();
}
// ? should we still check whether the stream was being read in filter phase?
}
}

0 comments on commit e791752

Please sign in to comment.