MCPcopy
hub / github.com/giancarloerra/SocratiCode / stopWatching

Function stopWatching

src/services/watcher.ts:213–231  ·  view source on GitHub ↗
(projectPath: string)

Source from the content-addressed store, hash-verified

211
212/** Stop watching a project directory */
213export 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 */
234export async function stopAllWatchers(): Promise<void> {

Callers 5

handleIndexToolFunction · 0.85
startWatchingFunction · 0.85
stopAllWatchersFunction · 0.85
watcher.test.tsFile · 0.85
watcher.test.tsFile · 0.85

Calls 3

releaseProjectLockFunction · 0.85
getMethod · 0.80
deleteMethod · 0.80

Tested by

no test coverage detected