Skip to content

Commit 69f9ecc

Browse files
committed
Delete unfinished downloads in case of retry
1 parent 9bd852a commit 69f9ecc

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

extensions/ql-vscode/src/variant-analysis/variant-analysis-results-manager.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { appendFile, pathExists } from "fs-extra";
1+
import { appendFile, pathExists, rm } from "fs-extra";
22
import fetch from "node-fetch";
33
import { EOL } from "os";
44
import { join } from "path";
@@ -82,6 +82,9 @@ export class VariantAnalysisResultsManager extends DisposableObject {
8282

8383
const zipFilePath = join(resultDirectory, "results.zip");
8484

85+
// in case of restarted download delete possible artifact from previous download
86+
await rm(zipFilePath, { force: true });
87+
8588
const response = await fetch(repoTask.artifactUrl);
8689

8790
let responseSize = parseInt(response.headers.get("content-length") || "0");

0 commit comments

Comments
 (0)