Skip to content
Snippets Groups Projects
Commit 0c0b4ba4 authored by Loïc Correnson's avatar Loïc Correnson Committed by David Bühler
Browse files

[ivette] better feedback on polling

parent eb44670c
No related branches found
No related tags found
No related merge requests found
......@@ -198,6 +198,8 @@ function _status(newStatus: Status): void {
}
}
const _update: () => void = debounce(() => STATUS.emit(status), 100);
// --------------------------------------------------------------------------
// --- Server Control (Start)
// --------------------------------------------------------------------------
......@@ -737,6 +739,7 @@ export function send<In, Out>(
pollingTimer = setInterval(() => {
client.poll();
}, polling);
_update();
}
return response;
}
......@@ -749,6 +752,7 @@ function _resolved(id: string): void {
pending.delete(id);
if (pending.size === 0) {
rqCount = 0;
_update();
if (pollingTimer) {
clearInterval(pollingTimer);
pollingTimer = undefined;
......
......@@ -385,7 +385,8 @@ export const Status = () => {
running = 'BOOT';
break;
case Server.Status.ON:
led = pending > 0 ? 'positive' : 'active';
led = 'active';
blink = pending > 0;
running = 'ON';
break;
case Server.Status.HALTING:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment