controller: turn an archetype agent into a custom one
This commit is contained in:
parent
8a7f254c74
commit
0737798d78
1 changed files with 1008 additions and 44 deletions
|
|
@ -472,6 +472,21 @@ pub(crate) async fn get_agents_status(
|
|||
row.needs_login = login.get(&row.name);
|
||||
}
|
||||
}
|
||||
// Absent on a failed read, like `wanted`: one unreadable bucket
|
||||
// must not blank the roster.
|
||||
if let Some(reader) = state.status.as_ref() {
|
||||
match agent_archetype::of_agents(&reader.queue_client(), &rows).await {
|
||||
Ok(mut archetypes) => {
|
||||
for row in &mut rows {
|
||||
row.archetype = archetypes.remove(&row.name);
|
||||
}
|
||||
}
|
||||
Err(e) => tracing::warn!(
|
||||
error = %format!("{e:#}"),
|
||||
"reading the agent archetypes failed; rows show none"
|
||||
),
|
||||
}
|
||||
}
|
||||
Ok(Json(rows))
|
||||
}
|
||||
Err(e) => {
|
||||
|
|
@ -1800,6 +1815,7 @@ mod tests {
|
|||
config_pr: None,
|
||||
wanted: None,
|
||||
needs_login: None,
|
||||
archetype: None,
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue