MCPcopy Create free account
hub / github.com/bearlyai/OpenADE / stopWatch

Function stopWatch

projects/runtime-node/src/fsWatch.ts:50–58  ·  view source on GitHub ↗
(server: RuntimeServer, fsWatches: Map<string, FsWatchState>, watchId: string)

Source from the content-addressed store, hash-verified

48}
49
50function stopWatch(server: RuntimeServer, fsWatches: Map<string, FsWatchState>, watchId: string): { ok: true; dir: string } | { ok: false; error: string } {
51 const watch = fsWatches.get(watchId)
52 if (!watch) return { ok: false, error: "watch not found" }
53 watch.watcher.close()
54 clearInterval(watch.poller)
55 fsWatches.delete(watchId)
56 server.notify("fs/watch/stopped", { watchId, dir: watch.dir, at: new Date().toISOString() })
57 return { ok: true, dir: watch.dir }
58}
59
60export function registerRuntimeNodeFsWatchModule(server: RuntimeServer): () => void {
61 const fsWatches = new Map<string, FsWatchState>()

Callers 1

Calls 4

notifyMethod · 0.80
getMethod · 0.65
closeMethod · 0.65
deleteMethod · 0.65

Tested by

no test coverage detected