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

Function shutdown

packages/server/scripts/dev.mjs:200–233  ·  view source on GitHub ↗
(signal)

Source from the content-addressed store, hash-verified

198 }
199
200 shuttingDown = true;
201
202 if (restartTimer) {
203 clearTimeout(restartTimer);
204 }
205 if (rescanTimer) {
206 clearTimeout(rescanTimer);
207 }
208
209 for (const watcher of watchedDirs.values()) {
210 watcher.close();
211 }
212 watchedDirs.clear();
213
214 if (!child) {
215 process.exit(0);
216 }
217
218 const childToStop = child;
219 void stopBackendAndWait(childToStop).then(() => process.exit(0));
220}
221
222syncWatchers();
223startServer();
224
225process.on('SIGINT', () => shutdown('SIGINT'));
226process.on('SIGTERM', () => shutdown('SIGTERM'));

Callers 1

dev.mjsFile · 0.70

Calls 2

onceMethod · 0.80
killMethod · 0.65

Tested by

no test coverage detected