🔒DB lock v0.4 #685 + 🔔userNotifications

This commit is contained in:
jokob-sk
2024-06-01 20:05:15 +10:00
parent 2e9aa37cd2
commit de561e1ad0
29 changed files with 1932 additions and 1460 deletions

View File

@@ -23,16 +23,19 @@ function readData(sqlQuery, processDataCallback, valuesArray, targetLocation, ta
// Check if database is locked
function checkDbLock() {
$.ajax({
url: 'php/server/dbHelper.php', // Replace with the actual path to your PHP file
url: 'log/db_is_locked.log', // Replace with the actual path to your PHP file
type: 'GET',
data: { action: 'checkLock' },
success: function(response) {
if (response == 1) {
console.log('🟥 Database is locked');
$(".header-status-locked-db").show()
} else {
// console.log(response);
if (response == 0) {
// console.log('Database is not locked');
$(".header-status-locked-db").hide()
} else {
console.log('🟥 Database is locked:');
console.log(response);
$(".header-status-locked-db").show()
}
},
error: function() {
@@ -42,7 +45,8 @@ function checkDbLock() {
});
}
// Start the loop
setInterval(() => {
checkDbLock();
}, 1000);
setInterval(checkDbLock(), 1000);