Merge pull request #742 from ente-io/cancel-stream-after-use

close stream after use
This commit is contained in:
Abhinav Kumar 2022-10-18 18:02:56 +05:30 committed by GitHub
commit 8daa2208fb
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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);
}