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

Function cached_foreground_app_with_ttl

packages/server/src/api/routes.rs:4354–4361  ·  view source on GitHub ↗
(udid: &str, ttl: Duration)

Source from the content-addressed store, hash-verified

4352}
4353
4354fn cached_foreground_app_with_ttl(udid: &str, ttl: Duration) -> Option<devtools::ForegroundApp> {
4355 let cache = FOREGROUND_APP_CACHE.get()?;
4356 let Ok(cache) = cache.lock() else {
4357 return None;
4358 };
4359 let cached = cache.get(udid)?;
4360 (cached.cached_at.elapsed() <= ttl).then(|| cached.foreground_app.clone())
4361}
4362
4363#[derive(Clone, Debug)]
4364struct UIKitApplicationService {

Calls 2

getMethod · 0.65
cloneMethod · 0.65

Tested by

no test coverage detected