diff --git a/src/util/httpRequest.ts b/src/util/httpRequest.ts index 3bba03de33f..1b9ef977053 100644 --- a/src/util/httpRequest.ts +++ b/src/util/httpRequest.ts @@ -85,7 +85,7 @@ function doDownload(url: string, destination: string, redirectCount: number, opt .pipe(fileOut) } - fileOut.on("finish", callback) + fileOut.on("finish", () => (fileOut.close)(callback)) }) .catch(callback)