rebuild_queue: switch dashboard / auto-update / manager call sites to enqueue
This commit is contained in:
parent
37f6bc4b6b
commit
11db5c2a8f
3 changed files with 48 additions and 139 deletions
|
|
@ -206,10 +206,9 @@ pub async fn run(coord: Arc<Coordinator>) -> Result<()> {
|
|||
}
|
||||
};
|
||||
|
||||
let current_rev =
|
||||
current_flake_rev(&coord.hyperhive_flake).unwrap_or_default();
|
||||
let _current_rev = current_flake_rev(&coord.hyperhive_flake).unwrap_or_default();
|
||||
|
||||
tracing::info!(agents = containers.len(), "auto-update: rebuilding all on startup");
|
||||
tracing::info!(agents = containers.len(), "auto-update: queueing all on startup");
|
||||
for container in containers {
|
||||
let logical = if container == MANAGER_NAME {
|
||||
Some(MANAGER_NAME.to_owned())
|
||||
|
|
@ -217,9 +216,14 @@ pub async fn run(coord: Arc<Coordinator>) -> Result<()> {
|
|||
container.strip_prefix(AGENT_PREFIX).map(str::to_owned)
|
||||
};
|
||||
let Some(name) = logical else { continue };
|
||||
if let Err(e) = rebuild_agent(&coord, &name, ¤t_rev).await {
|
||||
tracing::warn!(%name, error = ?e, "auto-update: rebuild failed");
|
||||
}
|
||||
coord.rebuild_queue.enqueue(
|
||||
crate::rebuild_queue::QueueKind::Rebuild,
|
||||
name,
|
||||
crate::rebuild_queue::QueueSource::AutoUpdate,
|
||||
"startup sweep".to_owned(),
|
||||
None,
|
||||
);
|
||||
}
|
||||
coord.emit_rebuild_queue_snapshot();
|
||||
Ok(())
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue