diff options
author | Simon Rettberg | 2014-06-02 20:02:31 +0200 |
---|---|---|
committer | Simon Rettberg | 2014-06-02 20:02:31 +0200 |
commit | 3b61c7568e7eeae048e04e76d2d6d65936e6734d (patch) | |
tree | c3589570fafb94905d3b1c16f558d5d8e4cd3498 /script | |
parent | Zeug (diff) | |
download | slx-admin-3b61c7568e7eeae048e04e76d2d6d65936e6734d.tar.gz slx-admin-3b61c7568e7eeae048e04e76d2d6d65936e6734d.tar.xz slx-admin-3b61c7568e7eeae048e04e76d2d6d65936e6734d.zip |
Fix tracking of js taskmanager poller status; remove obsolete hack from taskmanager php api backend
Diffstat (limited to 'script')
-rw-r--r-- | script/taskmanager.js | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/script/taskmanager.js b/script/taskmanager.js index 822d1421..c2305a2b 100644 --- a/script/taskmanager.js +++ b/script/taskmanager.js @@ -20,8 +20,9 @@ function tmInit() } item.prepend('<span class="data-tm-icon" />'); }); - if (!tmIsRunning) + if (!tmIsRunning) { setTimeout(tmUpdate, 50); + } tmIsRunning = true; } @@ -35,8 +36,10 @@ function tmUpdate() return; active.push(id); }); - if (active.length === 0) + if (active.length === 0) { + tmIsRunning = false; return; + } $.post('api.php?do=taskmanager', {'ids[]': active, token: TOKEN}, function(data, status) { // POST success tmIsRunning = tmResult(data, status); @@ -47,8 +50,9 @@ function tmUpdate() // POST failure console.log("TaskManager Error: " + textStatus + " - " + errorThrown); tmIsRunning = (++tmErrors < TM_MAX_ERRORS); - if (tmIsRunning) + if (tmIsRunning) { setTimeout(tmUpdate, 2000); + } }); } |