From 60d91b79c046deb58b9dfb52d9b83e43d9690eb6 Mon Sep 17 00:00:00 2001 From: Tom Smeding Date: Sat, 28 Mar 2020 21:25:44 +0100 Subject: controller: Properly keep track of # running jobs --- controller/src/lib.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/controller/src/lib.rs b/controller/src/lib.rs index e5d19ca..c74ff3f 100644 --- a/controller/src/lib.rs +++ b/controller/src/lib.rs @@ -507,6 +507,7 @@ impl ComputePool { // Send the job to the IO thread, which will send it to a round-robin worker self.runtime.block_on(self.outbound.send(Outbound::NewJob(jobid, input))).iores()?; + self.num_running += 1; Ok(()) } @@ -519,6 +520,7 @@ impl ComputePool { if self.num_running > 0 { match self.runtime.block_on(self.inbound.recv()) { Some(Inbound::Completion(event)) => { + self.num_running -= 1; Ok(Some(event)) }, None => Err("IO thread unexpectedly quit".ioerr()), -- cgit v1.2.3-70-g09d2