(command, cwd, timeoutMs = 120_000)
| 562 | } |
| 563 | } |
| 564 | return String(args) |
| 565 | } |
| 566 | |
| 567 | function rememberSession(directory, client, sessionID) { |
| 568 | if (!sessionID) return |
| 569 | knownSessions.set(sessionID, { directory, client, seenAt: now() }) |
| 570 | startHeartbeat() |
| 571 | } |
| 572 | |
| 573 | function startHeartbeat() { |
| 574 | if (heartbeatTimer) return |
| 575 | heartbeatTimer = setInterval(() => { |
| 576 | for (const [sessionID, info] of [...knownSessions.entries()]) { |
| 577 | if (!info || now() - (info.seenAt || 0) > 12 * 60 * 60 * 1000) { |
| 578 | knownSessions.delete(sessionID) |
no outgoing calls
no test coverage detected