close file when streaming done

This commit is contained in:
Rushikesh Tote 2022-07-22 13:32:05 +05:30
parent 47e7a9eccf
commit b3443a2526

View file

@ -41,6 +41,7 @@ const getFileStream = async (filePath: string) => {
offset += bytesRead;
if (bytesRead === 0) {
controller.close();
await fs.close(file);
} else {
controller.enqueue(buff);
}