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 | |
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
-rw-r--r-- | apis/taskmanager.inc.php | 4 | ||||
-rw-r--r-- | script/taskmanager.js | 10 |
2 files changed, 7 insertions, 7 deletions
diff --git a/apis/taskmanager.inc.php b/apis/taskmanager.inc.php index 7bb38a98..f7ee6ac1 100644 --- a/apis/taskmanager.inc.php +++ b/apis/taskmanager.inc.php @@ -20,10 +20,6 @@ foreach ($_POST['ids'] as $id) { && $id === Property::getIPxeTaskId() && Property::getServerIp() !== Property::getIPxeIp()) { Property::setIPxeIp(Property::getServerIp()); } - if (isset($status['statusCode']) && $status['statusCode'] === TASK_FINISHED // MiniLinux Version check - && $id === Property::getVersionCheckTaskId()) { - Property::setVersionCheckInformation(Property::getServerIp()); - } // -- END HACKS -- if (!isset($status['statusCode']) || ($status['statusCode'] !== TASK_WAITING && $status['statusCode'] !== TASK_PROCESSING)) { Taskmanager::release($id); 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); + } }); } |