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

Function shutdown

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

Source from the content-addressed store, hash-verified

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