Files
oh-my-opencode/src/hooks/anthropic-context-window-limit-recovery/session-timeout-map.ts
T
2026-04-04 15:38:46 +09:00

21 lines
523 B
TypeScript

export function clearSessionTimeout(
timeoutBySession: Map<string, ReturnType<typeof setTimeout>>,
sessionID: string,
): void {
const timeoutID = timeoutBySession.get(sessionID)
if (timeoutID !== undefined) {
clearTimeout(timeoutID)
timeoutBySession.delete(sessionID)
}
}
export function clearAllSessionTimeouts(
timeoutBySession: Map<string, ReturnType<typeof setTimeout>>,
): void {
for (const timeoutID of timeoutBySession.values()) {
clearTimeout(timeoutID)
}
timeoutBySession.clear()
}