mirror of
https://github.com/retspen/webvirtcloud
synced 2026-12-02 17:06:09 +00:00
fix(computes): hosts that do not answer no longer keep the Computes page from the others
The Computes page read its hosts on a pool of eight threads shared by the process: eight hosts that hang held all of them for as long as they hung, and every other host was then shown not connected. Each host is now read on a thread of its own (a daemon thread, which does not keep the process from exiting), one at a time per host as before. The UUID of a host added before host UUIDs were kept is read on that thread too, within the page's wait, instead of after it. A host's charts asked for each reading without a time limit: a reading the host kept waiting left the charts saying "Updated" and stopped the polling. A reading now ends after 30 s; the charts then say since when they are not updated, and the next reading goes out.
This commit is contained in:
parent
a998e68757
commit
1f6cc15ddf
5 changed files with 93 additions and 32 deletions
|
|
@ -27,7 +27,9 @@ function stale() {
|
|||
// the CPU sample of the previous answer: usage is taken since then
|
||||
var cpuSample = null;
|
||||
pollWhileVisible(5000, function () {
|
||||
return $.getJSON(state.dataset.url, cpuSample ? {cpu_sample: cpuSample} : {}).fail(stale);
|
||||
// a host that keeps a reading waiting: the charts say they are not updated, and the next poll goes out
|
||||
return $.ajax({url: state.dataset.url, data: cpuSample ? {cpu_sample: cpuSample} : {}, dataType: "json",
|
||||
timeout: 30000}).fail(stale);
|
||||
}, function (data) {
|
||||
cpuSample = data.cpu_sample || null;
|
||||
cpuWindows.push(data.window);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue