()
| 90 | } |
| 91 | |
| 92 | private startBroadScan(): void { |
| 93 | this.broadScanInterval = window.setInterval(() => { |
| 94 | void (async () => { |
| 95 | const now = Date.now(); |
| 96 | const timeSinceLastScan = now - this.lastBroadScanTime; |
| 97 | |
| 98 | // Check for system sleep/wake - if gap is significantly larger than interval, handle catch-up |
| 99 | if (timeSinceLastScan > this.BROAD_SCAN_INTERVAL + 60000) { |
| 100 | // 1 minute tolerance |
| 101 | await this.handleSystemWakeUp(); |
| 102 | } |
| 103 | |
| 104 | await this.scanTasksAndBuildQueue(); |
| 105 | this.lastBroadScanTime = now; |
| 106 | })(); |
| 107 | }, this.BROAD_SCAN_INTERVAL); |
| 108 | } |
| 109 | |
| 110 | private startQuickCheck(): void { |
| 111 | this.quickCheckInterval = window.setInterval(() => { |
no test coverage detected