MCPcopy Create free account
hub / github.com/tiann/hapi / waitForSessionActive

Method waitForSessionActive

hub/src/sync/syncEngine.ts:1413–1423  ·  view source on GitHub ↗
(sessionId: string, timeoutMs: number = 15_000)

Source from the content-addressed store, hash-verified

1411 }
1412
1413 async waitForSessionActive(sessionId: string, timeoutMs: number = 15_000): Promise<boolean> {
1414 const start = Date.now()
1415 while (Date.now() - start < timeoutMs) {
1416 const session = this.getSession(sessionId)
1417 if (session?.active) {
1418 return true
1419 }
1420 await new Promise((resolve) => setTimeout(resolve, 250))
1421 }
1422 return false
1423 }
1424
1425 async waitForSessionInactive(sessionId: string, timeoutMs: number = 15_000): Promise<boolean> {
1426 const start = Date.now()

Callers 1

resumeSessionMethod · 0.95

Calls 1

getSessionMethod · 0.95

Tested by

no test coverage detected