1
0
Fork 0

Try close stream before unlink

pull/661/head
Yang Cao 2020-12-03 13:34:59 -05:00
parent d4e990d92f
commit a600dd34a5
1 changed files with 1 additions and 0 deletions

View File

@ -223,6 +223,7 @@ export class DownloadHttpClient {
const resetDestinationStream = async (
fileDownloadPath: string
): Promise<void> => {
destinationStream.close()
await rmFile(fileDownloadPath)
destinationStream = fs.createWriteStream(fileDownloadPath)
}