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