(reason: SessionActivityReason)
| 119 | * and start an idle timer that logs after 30s of inactivity. |
| 120 | */ |
| 121 | export function stopSessionActivity(reason: SessionActivityReason): void { |
| 122 | if (refcount > 0) { |
| 123 | refcount-- |
| 124 | } |
| 125 | const n = (activeReasons.get(reason) ?? 0) - 1 |
| 126 | if (n > 0) activeReasons.set(reason, n) |
| 127 | else activeReasons.delete(reason) |
| 128 | if (refcount === 0 && heartbeatTimer !== null) { |
| 129 | clearInterval(heartbeatTimer) |
| 130 | heartbeatTimer = null |
| 131 | startIdleTimer() |
| 132 | } |
| 133 | } |
| 134 |
no test coverage detected