summaryrefslogtreecommitdiffstats
path: root/script
diff options
context:
space:
mode:
authorSimon Rettberg2014-06-02 20:02:31 +0200
committerSimon Rettberg2014-06-02 20:02:31 +0200
commit3b61c7568e7eeae048e04e76d2d6d65936e6734d (patch)
treec3589570fafb94905d3b1c16f558d5d8e4cd3498 /script
parentZeug (diff)
downloadslx-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.js10
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);
+ }
});
}