aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Smeding <tom.smeding@gmail.com>2020-03-28 21:25:44 +0100
committerTom Smeding <tom.smeding@gmail.com>2020-03-28 21:30:41 +0100
commit60d91b79c046deb58b9dfb52d9b83e43d9690eb6 (patch)
tree301f965845b84db2c468e3c9fe05f9440b17e03b
parent20d80818a3588aea6f5b8d258958da402a41f6bd (diff)
controller: Properly keep track of # running jobs
-rw-r--r--controller/src/lib.rs2
1 files changed, 2 insertions, 0 deletions
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()),