diff options
author | Malfurious <m@lfurio.us> | 2023-11-18 06:50:12 -0500 |
---|---|---|
committer | Malfurious <m@lfurio.us> | 2023-11-20 05:04:57 -0500 |
commit | e63a11dcd7f349077f09cac5012e52ec271516e9 (patch) | |
tree | 4b679ae3b47cebdc50de94f5de8965deee343553 /dmt | |
parent | e9bbc647e31248a3cde21ffa9977b5a3688cdb1e (diff) | |
download | cychedelic-e63a11dcd7f349077f09cac5012e52ec271516e9.tar.gz cychedelic-e63a11dcd7f349077f09cac5012e52ec271516e9.zip |
dmt: jobs: Invert default refresh time
Whenever we encounter an exception (which is usually due to a network
problem), default to the active refresh time as to recover from the
situation as soon as possible. Eg: Only wait the full idle time when
the server successfully reports it is idle.
There isn't even a real concern here of request load on the server,
since we can't reach the server in this condition anyway.
Signed-off-by: Malfurious <m@lfurio.us>
Diffstat (limited to 'dmt')
-rw-r--r-- | dmt/script.js | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/dmt/script.js b/dmt/script.js index e6b7b52..bc9554c 100644 --- a/dmt/script.js +++ b/dmt/script.js @@ -102,14 +102,14 @@ async function update_jobs() { let no_jobs = document.getElementById("no_jobs"); let list = document.getElementById("list"); - let timeout = %($CYCHE_IDLE_UPDATE%); + let timeout = %($CYCHE_ACTIVE_UPDATE%); try { let status = await api("/api/status"); if (version === null) { version = status.version; } if (version != status.version) { location.reload(); } - if (status.active) { timeout = %($CYCHE_ACTIVE_UPDATE%); } + if (!status.active) { timeout = %($CYCHE_IDLE_UPDATE%); } set_progress(nav_progress, (status.active ? null : "")); for (let i = status.oldest; i <= status.newest; i++) { |