0a7daa5d10
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent) Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
21 lines
523 B
TypeScript
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()
|
|
}
|