MCPcopy Index your code
hub / github.com/ChrisFeldmeier/OpenCodeRust / get_cached

Function get_cached

crates/opencode-config/src/wellknown.rs:140–149  ·  view source on GitHub ↗
(url: &str)

Source from the content-addressed store, hash-verified

138}
139
140fn get_cached(url: &str) -> Option<Config> {
141 let guard = CACHE.lock().ok()?;
142 let map = guard.as_ref()?;
143 let entry = map.get(url)?;
144 if entry.fetched_at.elapsed() < CACHE_TTL {
145 Some(entry.config.clone())
146 } else {
147 None
148 }
149}
150
151fn set_cached(url: String, config: Config) {
152 let mut guard = match CACHE.lock() {

Callers 2

load_wellknownFunction · 0.85

Calls 2

getMethod · 0.45
cloneMethod · 0.45

Tested by 1