Skip to content

Commit

Permalink
fix job list auto-updater
Browse files Browse the repository at this point in the history
  • Loading branch information
Robert Glonek committed Feb 21, 2024
1 parent d992515 commit f795f2e
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions web/dev/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -363,7 +363,7 @@ class Mutex {
}

var jobListMutex = new Mutex();
async function updateJobList(setTimer = false, firstRun = false) {
async function updateJobList(setTimer = false, noInventoryUpdate = false) {
var mutexunlock = await jobListMutex.lock();
$.getJSON("{{.WebRoot}}www/api/jobs/", function(data) {
document.getElementById("pending-action-count").innerText = data["RunningCount"];
Expand Down Expand Up @@ -439,7 +439,7 @@ async function updateJobList(setTimer = false, firstRun = false) {
$(jl).append(ln1+jobid+ln2+lnicon+ln3+data.Jobs[i]["Command"]+ln4+data.Jobs[i]["StartedWhen"]+ln5);
}
};
if (!firstRun) {
if (!noInventoryUpdate) {
updateCurrentInventoryPage();
};
})
Expand All @@ -452,7 +452,7 @@ async function updateJobList(setTimer = false, firstRun = false) {
})
.always(function(data) {
if (setTimer) {
setTimeout(updateJobList, 10000);
setTimeout(updateJobList, 10000, true, true);
};
mutexunlock();
});
Expand Down

0 comments on commit f795f2e

Please sign in to comment.