()
| 34 | * Call this when starting work that should keep the Mac awake. |
| 35 | */ |
| 36 | export function startPreventSleep(): void { |
| 37 | refCount++ |
| 38 | |
| 39 | if (refCount === 1) { |
| 40 | spawnCaffeinate() |
| 41 | startRestartInterval() |
| 42 | } |
| 43 | } |
| 44 | |
| 45 | /** |
| 46 | * Decrement the reference count and allow sleep if no more work is pending. |
no test coverage detected