(projectPath: string)
| 211 | |
| 212 | /** Stop watching a project directory */ |
| 213 | export async function stopWatching(projectPath: string): Promise<void> { |
| 214 | const resolvedPath = path.resolve(projectPath); |
| 215 | const subscription = subscriptions.get(resolvedPath); |
| 216 | |
| 217 | if (subscription) { |
| 218 | await subscription.unsubscribe(); |
| 219 | subscriptions.delete(resolvedPath); |
| 220 | watcherErrorCounts.delete(resolvedPath); |
| 221 | |
| 222 | const timer = debounceTimers.get(resolvedPath); |
| 223 | if (timer) { |
| 224 | clearTimeout(timer); |
| 225 | debounceTimers.delete(resolvedPath); |
| 226 | } |
| 227 | |
| 228 | await releaseProjectLock(resolvedPath, "watch"); |
| 229 | logger.info("File watcher stopped", { projectPath: resolvedPath }); |
| 230 | } |
| 231 | } |
| 232 | |
| 233 | /** Stop all active watchers */ |
| 234 | export async function stopAllWatchers(): Promise<void> { |
no test coverage detected