aboutsummaryrefslogtreecommitdiff
path: root/src/worker_ws.rs
diff options
context:
space:
mode:
authormetamuffin <metamuffin@disroot.org>2025-06-15 12:24:03 +0200
committermetamuffin <metamuffin@disroot.org>2025-06-15 12:24:03 +0200
commit88a45d8003deb6804f90313e994fac1bf8eefce6 (patch)
tree3ec1722244c64c8f91afce8d71a3d134d30b0a2d /src/worker_ws.rs
parent770832dc6ab62bc2ad260bfbd46e1d0a26cc9865 (diff)
downloadisda-88a45d8003deb6804f90313e994fac1bf8eefce6.tar
isda-88a45d8003deb6804f90313e994fac1bf8eefce6.tar.bz2
isda-88a45d8003deb6804f90313e994fac1bf8eefce6.tar.zst
fix bug where too many tasks where assigned
Diffstat (limited to 'src/worker_ws.rs')
-rw-r--r--src/worker_ws.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/worker_ws.rs b/src/worker_ws.rs
index fa43721..b057ca1 100644
--- a/src/worker_ws.rs
+++ b/src/worker_ws.rs
@@ -303,8 +303,8 @@ impl State {
pub fn dispatch_work(&mut self) {
let mut to_send = Vec::new();
for (id, w) in &mut self.workers {
- if w.accept >= 1 {
- for kind in &w.task_kinds {
+ for kind in &w.task_kinds {
+ if w.accept > 0 {
let prefix = format!("{kind}:");
let Some(first) = self.queue.iter().find(|e| e.starts_with(&prefix)).cloned()
else {