MCPcopy Create free account
hub / github.com/OpenHands/OpenHands / shutdown

Function shutdown

scripts/dev-static.mjs:550–571  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

548// ═══════════════════════════════════════════════════════════════════════════
549
550function shutdown() {
551 if (shuttingDown) return;
552 shuttingDown = true;
553
554 console.log("");
555 console.log(`${c.yellow}Shutting down...${c.reset}`);
556
557 for (const [name, proc] of processes) {
558 logService(name, "Stopping...", c.dim);
559 signalProcessTree(proc, "SIGTERM");
560 }
561
562 setTimeout(() => {
563 for (const [name, proc] of processes) {
564 if (isProcessRunning(proc)) {
565 logService(name, "Force stopping...", c.dim);
566 signalProcessTree(proc, "SIGKILL");
567 }
568 }
569 process.exit(0);
570 }, 3000);
571}
572
573process.on("SIGINT", shutdown);
574process.on("SIGTERM", shutdown);

Callers

nothing calls this directly

Calls 3

signalProcessTreeFunction · 0.90
isProcessRunningFunction · 0.90
logServiceFunction · 0.70

Tested by

no test coverage detected