From 903a261593a48d43cb003085769d8ce2b8bbda7e Mon Sep 17 00:00:00 2001 From: ehpersonal38 <103586016+ehpersonal38@users.noreply.github.com> Date: Sun, 29 May 2022 15:27:07 -0400 Subject: [PATCH] Suppressing "Database is busy" --- scripts/overview.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/scripts/overview.php b/scripts/overview.php index c77db38..6a668be 100644 --- a/scripts/overview.php +++ b/scripts/overview.php @@ -285,7 +285,9 @@ function loadDetectionIfNewExists(previous_detection_identifier=undefined) { function loadLeftChart() { const xhttp = new XMLHttpRequest(); xhttp.onload = function() { - document.getElementsByClassName("left-column")[0].innerHTML = this.responseText; + if(this.responseText.length > 0 && !this.responseText.includes("Database is busy")) { + document.getElementsByClassName("left-column")[0].innerHTML = this.responseText; + } } xhttp.open("GET", "overview.php?ajax_left_chart=true", true); xhttp.send(); @@ -306,7 +308,9 @@ window.setInterval(function(){ function loadFiveMostRecentDetections() { const xhttp = new XMLHttpRequest(); xhttp.onload = function() { - document.getElementById("detections_table").innerHTML= this.responseText; + if(this.responseText.length > 0 && !this.responseText.includes("Database is busy")) { + document.getElementById("detections_table").innerHTML= this.responseText; + } } if (window.innerWidth > 500) { xhttp.open("GET", "todays_detections.php?ajax_detections=true&display_limit=undefined&hard_limit=5", true);