MCPcopy Create free account
hub / github.com/NativeScript/SimDeck / wait_for_service

Function wait_for_service

packages/server/src/main.rs:2219–2231  ·  view source on GitHub ↗
(metadata: &ServiceMetadata, timeout: Duration)

Source from the content-addressed store, hash-verified

2217}
2218
2219fn wait_for_service(metadata: &ServiceMetadata, timeout: Duration) -> anyhow::Result<()> {
2220 let deadline = Instant::now() + timeout;
2221 while Instant::now() < deadline {
2222 if service_is_healthy(metadata) {
2223 return Ok(());
2224 }
2225 std::thread::sleep(Duration::from_millis(50));
2226 }
2227 anyhow::bail!(
2228 "Timed out waiting for SimDeck service at {}",
2229 metadata.http_url
2230 )
2231}
2232
2233fn wait_for_pairing_target(target: &PairingTarget, timeout: Duration) -> anyhow::Result<()> {
2234 let deadline = Instant::now() + timeout;

Callers 2

start_project_serviceFunction · 0.85

Calls 2

service_is_healthyFunction · 0.85
sleepFunction · 0.50

Tested by

no test coverage detected