Skip to content

Commit 2d992bf

Browse files
Japneet Singh ChawlaJapneet Singh Chawla
authored andcommitted
async file delete command fixed
1 parent f8c3a3f commit 2d992bf

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

commands/generate_reports.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ function download_artefact(username, access_key, env, test_id, file_path) {
2727
password: access_key,
2828
},
2929
gzip: true,
30+
timeout: 120000,
3031
},
3132
(err, res, body) => {
3233
if (err) {
@@ -45,6 +46,7 @@ function download_artefact(username, access_key, env, test_id, file_path) {
4546
zip.on("ready", () => {
4647
zip.extract(null, old_path, (err, count) => {
4748
zip.close();
49+
fs.unlinkSync(file_path);
4850
resolve(
4951
err
5052
? "Extract error for " + test_id
@@ -53,10 +55,9 @@ function download_artefact(username, access_key, env, test_id, file_path) {
5355
});
5456
});
5557
} else {
58+
fs.unlinkSync(file_path);
5659
reject("Could not download artefacts for test id " + test_id);
5760
}
58-
//delete the zip file
59-
fs.unlinkSync(file_path);
6061
})
6162
);
6263
});

0 commit comments

Comments
 (0)