fix(anthropic-recovery): add session timeout cleanup helpers
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent) Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
This commit is contained in:
@@ -0,0 +1,20 @@
|
||||
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()
|
||||
}
|
||||
Reference in New Issue
Block a user