From 5adf3d03e5fbc3b2d4abdacdd848659fb7015b06 Mon Sep 17 00:00:00 2001 From: diogo464 Date: Sun, 17 Aug 2025 18:20:41 +0100 Subject: only consider running oar jobs when listing them --- src/oar.rs | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/oar.rs b/src/oar.rs index 5a702b4..fb73109 100644 --- a/src/oar.rs +++ b/src/oar.rs @@ -153,7 +153,16 @@ fn extract_job_ids_from_oarstat_output(output: &str) -> Result> { }; let mut job_ids = Vec::default(); - for key in object.keys() { + for (key, val) in object.iter() { + if val + .get("state") + .expect("job should have a 'state' key") + .as_str() + .expect("job state should be a string") + != "Running" + { + continue; + } tracing::trace!("parsing key '{key}'"); let job_id = key.parse()?; job_ids.push(job_id); -- cgit