diff options
| author | diogo464 <[email protected]> | 2025-08-17 18:20:41 +0100 |
|---|---|---|
| committer | diogo464 <[email protected]> | 2025-08-17 18:20:41 +0100 |
| commit | 5adf3d03e5fbc3b2d4abdacdd848659fb7015b06 (patch) | |
| tree | 85d3db42f4769c3e12e484ba868759d1f2e5221e /src/oar.rs | |
| parent | 9266fe01db3de3f1142df1b52f70929e75580c0b (diff) | |
only consider running oar jobs when listing them
Diffstat (limited to 'src/oar.rs')
| -rw-r--r-- | src/oar.rs | 11 |
1 files changed, 10 insertions, 1 deletions
| @@ -153,7 +153,16 @@ fn extract_job_ids_from_oarstat_output(output: &str) -> Result<Vec<u32>> { | |||
| 153 | }; | 153 | }; |
| 154 | 154 | ||
| 155 | let mut job_ids = Vec::default(); | 155 | let mut job_ids = Vec::default(); |
| 156 | for key in object.keys() { | 156 | for (key, val) in object.iter() { |
| 157 | if val | ||
| 158 | .get("state") | ||
| 159 | .expect("job should have a 'state' key") | ||
| 160 | .as_str() | ||
| 161 | .expect("job state should be a string") | ||
| 162 | != "Running" | ||
| 163 | { | ||
| 164 | continue; | ||
| 165 | } | ||
| 157 | tracing::trace!("parsing key '{key}'"); | 166 | tracing::trace!("parsing key '{key}'"); |
| 158 | let job_id = key.parse()?; | 167 | let job_id = key.parse()?; |
| 159 | job_ids.push(job_id); | 168 | job_ids.push(job_id); |
