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

Method waitForSessionInactive

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

Source from the content-addressed store, hash-verified

1423 }
1424
1425 async waitForSessionInactive(sessionId: string, timeoutMs: number = 15_000): Promise<boolean> {
1426 const start = Date.now()
1427 while (Date.now() - start < timeoutMs) {
1428 const session = this.getSession(sessionId)
1429 if (!session?.active) {
1430 return true
1431 }
1432 await new Promise((resolve) => setTimeout(resolve, 250))
1433 }
1434 return false
1435 }
1436
1437 async checkPathsExist(machineId: string, paths: string[]): Promise<Record<string, boolean>> {
1438 return await this.rpcGateway.checkPathsExist(machineId, paths)

Callers 1

handoffSessionToLocalMethod · 0.95

Calls 1

getSessionMethod · 0.95

Tested by

no test coverage detected