MCPcopy Create free account
hub / github.com/NVIDIA/OpenShell / health_router

Function health_router

crates/openshell-server/src/http.rs:150–153  ·  view source on GitHub ↗

Build the health router by spawning a background [`DatabaseHealthMonitor`] for `store` and wiring its receiver into the handlers. Returns immediately so the listener is responsive from t=0. The router's initial state is [`HealthState::Initializing`] — `/readyz` and `/health` will return `503` with a structured `{"checks": {"database": {"status": "initializing"}}}` payload until the background mon

(store: Arc<Store>)

Source from the content-addressed store, hash-verified

148/// The background task continues running detached for the remainder of the
149/// runtime.
150pub fn health_router(store: Arc<Store>) -> Router {
151 let monitor = DatabaseHealthMonitor::spawn(store);
152 health_router_from_receiver(monitor.subscribe())
153}
154
155/// Build the health router from an existing monitor receiver.
156///

Calls 3

spawnFunction · 0.50
subscribeMethod · 0.45

Tested by 8

spawn_gatewayFunction · 0.68
start_health_serverFunction · 0.68
start_grpc_serverFunction · 0.68
start_ws_tunnel_serverFunction · 0.68
start_test_serverFunction · 0.68