Only provide the last batch info

This commit is contained in:
Clément Renault
2025-11-20 12:02:29 +01:00
parent a8d55562e9
commit d5a5372aba

View File

@@ -186,8 +186,8 @@ pub async fn get_metrics(
&Query { statuses: Some(vec![Status::Succeeded, Status::Failed]), ..Query::default() },
auth_filters,
)?;
// ...and get the last three batches only.
for batch in batches.into_iter().take(3) {
// ...and get the last batch only.
if let Some(batch) = batches.into_iter().next() {
let batch_uid = batch.uid.to_string();
for (step_name, duration_str) in batch.stats.progress_trace {
let Some(duration_str) = duration_str.as_str() else { continue };