swarm daemons: opt-in /healthz and /readyz listener, and /readyz on the controller
This commit is contained in:
parent
377bc1d5df
commit
c21b158884
1 changed files with 787 additions and 26 deletions
|
|
@ -107,6 +107,11 @@ async fn main() -> 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 metrics = Arc::new(Metrics::from_env());
|
||||
let logins = Arc::new(login::Logins::new(
|
||||
|
|
@ -134,13 +139,16 @@ async fn main() -> Result<()> {
|
|||
.map(PathBuf::from),
|
||||
})
|
||||
.await?;
|
||||
swarm_queue_client::ready_when_connected(&health, &queue);
|
||||
// No queue group: a running login lives in this process's memory, so
|
||||
// every step for it has to reach this process.
|
||||
let mut requests = queue
|
||||
.subscribe(SUBJECT)
|
||||
.await
|
||||
.with_context(|| format!("subscribing to {SUBJECT}"))?
|
||||
.take_until(stop.clone());
|
||||
let mut requests = health.beating(
|
||||
queue
|
||||
.subscribe(SUBJECT)
|
||||
.await
|
||||
.with_context(|| format!("subscribing to {SUBJECT}"))?
|
||||
.take_until(stop.clone()),
|
||||
);
|
||||
tracing::info!(subject = SUBJECT, "claude login minter: awaiting logins");
|
||||
|
||||
let mut in_flight = swarm_secret_client::InFlight::new();
|
||||
|
|
|
|||
Loading…
Reference in a new issue