Skip to content

Commit 64bca45

Browse files
Update background.js
1 parent 99ae8f3 commit 64bca45

File tree

1 file changed

+25
-0
lines changed

1 file changed

+25
-0
lines changed

background.js

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -842,6 +842,9 @@ function analyze_boc() {
842842
} else {
843843
console.log("Problems in calculating Bug Issues metric")
844844
}
845+
setTimeout(() => {
846+
delete_repo()
847+
}, 1500);
845848
}
846849
xhttp.open("POST", req_url, "true");
847850
xhttp.setRequestHeader('Content-type', "application/x-www-form-urlencoded");
@@ -959,6 +962,27 @@ function analyze_scm() {
959962

960963
}
961964

965+
function delete_repo() {
966+
add_insights()
967+
var req_url = "https://services.iittp.ac.in/gitq/delete/" + latest_commit
968+
console.log(req_url)
969+
document.body.style.background = "#ffffff";
970+
setTimeout(() => {
971+
var xhttp = new XMLHttpRequest();
972+
xhttp.onreadystatechange = function () {
973+
if (this.readyState == 4 && this.status == 200) {
974+
console.log("Repo Has been deleted Successfully")
975+
} else {
976+
console.log("Problems in deleting the repository in the remote server")
977+
}
978+
}
979+
xhttp.open("POST", req_url, "true");
980+
xhttp.setRequestHeader('Content-type', "application/x-www-form-urlencoded");
981+
xhttp.send('delete_request');
982+
}, 300);
983+
984+
}
985+
962986

963987
function download_repository() {
964988
document.getElementsByClassName("Box mb-3")[0].innerHTML = downloading_buffer + entire_code;
@@ -983,6 +1007,7 @@ function download_repository() {
9831007
setTimeout(() => {
9841008
analyze_boc()
9851009
}, 2500);
1010+
9861011
} else {
9871012
console.log("Problems in downloading the repo!")
9881013
}

0 commit comments

Comments
 (0)