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

Function render_database

crates/openshell-server/src/http.rs:115–138  ·  view source on GitHub ↗
(state: &HealthState)

Source from the content-addressed store, hash-verified

113}
114
115fn render_database(state: &HealthState) -> DependencyCheck {
116 match state {
117 HealthState::Initializing => DependencyCheck {
118 status: STATUS_UNHEALTHY,
119 latency_ms: None,
120 error: Some(DATABASE_INITIALIZING_ERROR.to_string()),
121 },
122 HealthState::Healthy { latency_ms } => DependencyCheck {
123 status: STATUS_HEALTHY,
124 latency_ms: Some(*latency_ms),
125 error: None,
126 },
127 HealthState::Unhealthy(HealthError::Unavailable { latency_ms }) => DependencyCheck {
128 status: STATUS_UNHEALTHY,
129 latency_ms: Some(*latency_ms),
130 error: Some(DATABASE_UNAVAILABLE_ERROR.to_string()),
131 },
132 HealthState::Unhealthy(HealthError::Timeout) => DependencyCheck {
133 status: STATUS_UNHEALTHY,
134 latency_ms: None,
135 error: Some(DATABASE_TIMEOUT_ERROR.to_string()),
136 },
137 }
138}
139
140/// Build the health router by spawning a background [`DatabaseHealthMonitor`]
141/// for `store` and wiring its receiver into the handlers.

Callers 1

render_responseFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected