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

Function shutdown

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

Source from the content-addressed store, hash-verified

487// ═══════════════════════════════════════════════════════════════════════════
488
489function shutdown() {
490 if (shuttingDown) return;
491 shuttingDown = true;
492
493 console.log("");
494 console.log(`${c.yellow}Shutting down...${c.reset}`);
495
496 for (const [name, proc] of processes) {
497 logService(name, "Stopping...", c.dim);
498 signalProcessTree(proc, "SIGTERM");
499 }
500
501 setTimeout(() => {
502 for (const [name, proc] of processes) {
503 if (isProcessRunning(proc)) {
504 logService(name, "Force stopping...", c.dim);
505 signalProcessTree(proc, "SIGKILL");
506 }
507 }
508 process.exit(0);
509 }, 3000);
510}
511
512process.on("SIGINT", shutdown);
513process.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