auto-update agents on startup when hyperhive rev changes

This commit is contained in:
müde 2026-05-15 13:25:27 +02:00
parent 1cbfacda20
commit a4e1556f90
3 changed files with 141 additions and 0 deletions

View file

@ -8,6 +8,7 @@ use hive_sh4re::{HostRequest, HostResponse};
mod actions;
mod agent_server;
mod approvals;
mod auto_update;
mod broker;
mod client;
mod coordinator;
@ -85,6 +86,15 @@ async fn main() -> Result<()> {
dashboard_port,
} => {
let coord = Arc::new(Coordinator::open(&db, hyperhive_flake)?);
// Run auto-update in the background — don't block service start.
// Operators sometimes need the admin socket up to debug a stuck
// agent, and the rebuild loop can take tens of seconds.
let update_coord = coord.clone();
tokio::spawn(async move {
if let Err(e) = auto_update::run(update_coord).await {
tracing::warn!(error = ?e, "auto-update task failed");
}
});
manager_server::start(coord.clone())?;
let dash_coord = coord.clone();
tokio::spawn(async move {