MCPcopy Create free account
hub / github.com/AI45Lab/Code / touch_updates_last_used_at_ms

Function touch_updates_last_used_at_ms

core/src/mcp/manager.rs:839–850  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

837
838 #[tokio::test]
839 async fn touch_updates_last_used_at_ms() {
840 let manager = McpManager::new();
841 // Without a real connect, last_used is None.
842 assert!(manager.last_used_at_ms("svc-a").await.is_none());
843 manager.touch("svc-a").await;
844 let t1 = manager.last_used_at_ms("svc-a").await.expect("set");
845 assert!(t1 > 0);
846 // Touch again — timestamp must be monotonically non-decreasing.
847 manager.touch("svc-a").await;
848 let t2 = manager.last_used_at_ms("svc-a").await.expect("set again");
849 assert!(t2 >= t1);
850 }
851
852 #[tokio::test]
853 async fn disconnect_idle_drops_stale_servers_and_keeps_fresh_ones() {

Callers

nothing calls this directly

Calls 3

touchMethod · 0.80
expectMethod · 0.80
last_used_at_msMethod · 0.80

Tested by

no test coverage detected