Suppressing "Database is busy"

This commit is contained in:
ehpersonal38
2022-05-29 15:27:07 -04:00
parent 278227f559
commit 903a261593
+4
View File
@@ -285,8 +285,10 @@ function loadDetectionIfNewExists(previous_detection_identifier=undefined) {
function loadLeftChart() { function loadLeftChart() {
const xhttp = new XMLHttpRequest(); const xhttp = new XMLHttpRequest();
xhttp.onload = function() { xhttp.onload = function() {
if(this.responseText.length > 0 && !this.responseText.includes("Database is busy")) {
document.getElementsByClassName("left-column")[0].innerHTML = this.responseText; document.getElementsByClassName("left-column")[0].innerHTML = this.responseText;
} }
}
xhttp.open("GET", "overview.php?ajax_left_chart=true", true); xhttp.open("GET", "overview.php?ajax_left_chart=true", true);
xhttp.send(); xhttp.send();
} }
@@ -306,8 +308,10 @@ window.setInterval(function(){
function loadFiveMostRecentDetections() { function loadFiveMostRecentDetections() {
const xhttp = new XMLHttpRequest(); const xhttp = new XMLHttpRequest();
xhttp.onload = function() { xhttp.onload = function() {
if(this.responseText.length > 0 && !this.responseText.includes("Database is busy")) {
document.getElementById("detections_table").innerHTML= this.responseText; document.getElementById("detections_table").innerHTML= this.responseText;
} }
}
if (window.innerWidth > 500) { if (window.innerWidth > 500) {
xhttp.open("GET", "todays_detections.php?ajax_detections=true&display_limit=undefined&hard_limit=5", true); xhttp.open("GET", "todays_detections.php?ajax_detections=true&display_limit=undefined&hard_limit=5", true);
} else { } else {