close file when streaming done
This commit is contained in:
parent
47e7a9eccf
commit
b3443a2526
|
@ -41,6 +41,7 @@ const getFileStream = async (filePath: string) => {
|
|||
offset += bytesRead;
|
||||
if (bytesRead === 0) {
|
||||
controller.close();
|
||||
await fs.close(file);
|
||||
} else {
|
||||
controller.enqueue(buff);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue