aboutsummaryrefslogtreecommitdiff
path: root/src/worker_ws.rs
diff options
context:
space:
mode:
authormetamuffin <metamuffin@disroot.org>2025-05-18 15:11:00 +0200
committermetamuffin <metamuffin@disroot.org>2025-05-18 15:11:00 +0200
commit441142f26921510a049d6a8458026c7c6d962ca1 (patch)
tree39d19bbb3b4801ba3b47bcde0d0572007faedcd7 /src/worker_ws.rs
parentf59dcc4a77412750f8dde72ed335a8262206ef5d (diff)
downloadisda-441142f26921510a049d6a8458026c7c6d962ca1.tar
isda-441142f26921510a049d6a8458026c7c6d962ca1.tar.bz2
isda-441142f26921510a049d6a8458026c7c6d962ca1.tar.zst
fix a few live updating bugs
Diffstat (limited to 'src/worker_ws.rs')
-rw-r--r--src/worker_ws.rs6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/worker_ws.rs b/src/worker_ws.rs
index c98e08d..25ec7b0 100644
--- a/src/worker_ws.rs
+++ b/src/worker_ws.rs
@@ -143,7 +143,8 @@ async fn worker_websocket_inner(ws: WebSocket, state: Arc<RwLock<State>>) {
// recycle incomplete tasks
for key in w.assigned_tasks {
g.loading.remove(&key);
- g.queue.insert(key);
+ g.queue.insert(key.clone());
+ g.send_webui_task_update(&key);
}
g.send_webui_worker_removal(worker);
}
@@ -163,6 +164,7 @@ impl State {
WorkerRequest::Register { name, task_kinds } => {
worker.name = name;
worker.task_kinds = task_kinds;
+ self.send_webui_worker_update(w);
}
WorkerRequest::Metadata { key, data } => {
let m = self.metadata.entry(key.clone()).or_default();
@@ -199,6 +201,7 @@ impl State {
self.loading.remove(&key);
self.complete.insert(key.clone());
self.send_webui_task_update(&key);
+ self.send_webui_worker_update(w);
} else {
bail!("task was not assigned")
}
@@ -239,6 +242,7 @@ impl State {
self.queue.remove(&key);
self.loading.insert(key.clone());
self.send_webui_task_update(&key);
+ self.send_webui_worker_update(w);
self.send_to_worker(
w,
WorkerResponse::Work {