Merge pull request #742 from ente-io/cancel-stream-after-use
close stream after use
This commit is contained in:
commit
8daa2208fb
|
@ -73,6 +73,7 @@ async function extractElectronFileType(file: ElectronFile) {
|
|||
const stream = await file.stream();
|
||||
const reader = stream.getReader();
|
||||
const { value: fileDataChunk } = await reader.read();
|
||||
await reader.cancel();
|
||||
return getFileTypeFromBuffer(fileDataChunk);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue