From 5fdd3e6de9dafb164017ac56572b73a3244a595d Mon Sep 17 00:00:00 2001 From: haopeng Date: Fri, 26 Aug 2022 18:14:49 +0800 Subject: [PATCH] fix: close file stream when error --- packages/builder-util-runtime/src/httpExecutor.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/builder-util-runtime/src/httpExecutor.ts b/packages/builder-util-runtime/src/httpExecutor.ts index 0bca9b0c37..0a2035550f 100644 --- a/packages/builder-util-runtime/src/httpExecutor.ts +++ b/packages/builder-util-runtime/src/httpExecutor.ts @@ -485,6 +485,7 @@ function configurePipes(options: DownloadCallOptions, response: IncomingMessage) let lastStream = response for (const stream of streams) { stream.on("error", (error: Error) => { + fileOut.close() if (!options.options.cancellationToken.cancelled) { options.callback(error) }