readiness follows a cached store check instead of a constant or a login per probe
This commit is contained in:
parent
2eacb83b21
commit
b0239914b8
1 changed files with 369 additions and 40 deletions
|
|
@ -240,7 +240,12 @@ async fn main() -> anyhow::Result<()> {
|
|||
std::fs::set_permissions(&args.socket, std::fs::Permissions::from_mode(0o666))
|
||||
.with_context(|| format!("chmod {}", args.socket.display()))?;
|
||||
tracing::info!(socket = %args.socket.display(), "swarm-logs-auth listening");
|
||||
health.ready_when(|| true);
|
||||
// Ready means the store answers: with it down every request is a 401.
|
||||
let probe = Arc::clone(&responder);
|
||||
health.ready_while_checked(move || {
|
||||
let probe = Arc::clone(&probe);
|
||||
async move { probe.source.check_login().await }
|
||||
});
|
||||
|
||||
let app = axum::Router::new().fallback(handle).with_state(responder);
|
||||
serve(listener, app, stop).await
|
||||
|
|
|
|||
Loading…
Reference in a new issue