Watch
0
0
Fork
You've already forked hyperhive
0

swarm daemons: opt-in /healthz and /readyz listener, and /readyz on the controller

This commit is contained in:
atlas 2026-11-18 13:52:36 +01:00 • committed by mara
commit c21b158884

View file

@ -54,6 +54,11 @@ async fn serve() -> Result<()> {
let full = format!("{PREFIX}_{name}");
std::env::var(&full).with_context(|| format!("{full} is unset"))
};
let health = swarm_secret_client::health::Health::from_env(
&format!("{PREFIX}_HEALTH_ADDR"),
stop.clone(),
)
.await?;
let client_id = var("OIDC_CLIENT_ID")?;
let trampoline =
std::env::current_exe().context("finding this binary for the child trampoline")?;
@ -90,11 +95,14 @@ async fn serve() -> Result<()> {
.map(PathBuf::from),
})
.await?;
let mut requests = queue
.queue_subscribe(SUBJECT, QUEUE_GROUP.to_owned())
.await
.with_context(|| format!("subscribing to {SUBJECT}"))?
.take_until(stop.clone());
swarm_queue_client::ready_when_connected(&health, &queue);
let mut requests = health.beating(
queue
.queue_subscribe(SUBJECT, QUEUE_GROUP.to_owned())
.await
.with_context(|| format!("subscribing to {SUBJECT}"))?
.take_until(stop.clone()),
);
tracing::info!(subject = SUBJECT, "review classifier: awaiting try-outs");
let models = std::sync::Arc::new(models);