Faster startup: parallel catalog (stale-while-revalidate), MCP overlaps catalog, parallel extensions, single prompt scan, 10s MCP connect timeout, HX_TRACE_STARTUP
This commit is contained in:
1 parent
7a238e0e51
commit
6c8d492ca5
6 files changed
+83
-33
No files matched your search
@@ -146,6 +146,14 @@ fn read_cache(k: Kind) -> Option<Cache> {
|
||||
.filter(|c| !c.models.is_empty())
|
||||
}
|
||||
|
||||
/// Cached list for `k` at any age, and whether it is still fresh.
|
||||
pub fn cached(k: Kind) -> Option<(Vec<ModelInfo>, bool)> {
|
||||
read_cache(k).map(|c| {
|
||||
let fresh = now().saturating_sub(c.fetched) < CACHE_SECS;
|
||||
(c.models, fresh)
|
||||
})
|
||||
}
|
||||
|
||||
/// Live model list for `k` via `p`, cached for an hour (`refresh` skips the cache).
|
||||
/// On fetch failure: the expired cache if any, else the built-in list; `Source::Failed` says which.
|
||||
pub async fn load_with(
|
||||
|
||||
Reference in new issue
Block a user