MCPcopy Create free account
hub / github.com/UsefulSoftwareCo/executor / isDeadSessionCached

Function isDeadSessionCached

apps/cloud/src/mcp/agent-handler.ts:45–52  ·  view source on GitHub ↗
(sessionId: string, now = Date.now())

Source from the content-addressed store, hash-verified

43type DeadSessionReason = "not_found" | "timed_out";
44
45const isDeadSessionCached = (sessionId: string, now = Date.now()): boolean => {
46 const expiry = deadSessionExpiries.get(sessionId);
47 if (expiry === undefined) return false;
48 if (expiry > now) return true;
49 deadSessionExpiries.delete(sessionId);
50 timedOutSessionIds.delete(sessionId);
51 return false;
52};
53
54const cacheDeadSession = (sessionId: string, reason: DeadSessionReason, now = Date.now()): void => {
55 deadSessionExpiries.delete(sessionId);

Callers 1

makeCloudMcpAgentHandlerFunction · 0.70

Calls 2

getMethod · 0.65
deleteMethod · 0.65

Tested by

no test coverage detected