MCPcopy Create free account
hub / github.com/agent-tower/core / syncWatchers

Function syncWatchers

packages/server/scripts/dev.mjs:110–133  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

108 watchedDirs.set(dir, watcher);
109}
110
111function syncWatchers() {
112 const nextDirs = new Set();
113
114 for (const root of watchRoots) {
115 for (const dir of listDirectories(root)) {
116 nextDirs.add(dir);
117 }
118 }
119
120 for (const [dir, watcher] of watchedDirs) {
121 if (nextDirs.has(dir)) {
122 continue;
123 }
124
125 watcher.close();
126 watchedDirs.delete(dir);
127 }
128
129 for (const dir of nextDirs) {
130 if (!watchedDirs.has(dir)) {
131 addWatcher(dir);
132 }
133 }
134}
135
136function startServer() {

Callers 3

scheduleRescanFunction · 0.85
scheduleRestartFunction · 0.85
dev.mjsFile · 0.85

Calls 4

listDirectoriesFunction · 0.85
addWatcherFunction · 0.85
hasMethod · 0.45
deleteMethod · 0.45

Tested by

no test coverage detected