MCPcopy
hub / github.com/CapSoftware/Cap / shutdown

Function shutdown

apps/media-server/src/index.ts:11–21  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

9let shuttingDown = false;
10
11const shutdown = async () => {
12 if (shuttingDown) return;
13 shuttingDown = true;
14 console.log("[media-server] Shutting down...");
15 const abortedJobs = await abortAllJobs();
16 if (abortedJobs > 0) {
17 console.log(`[media-server] Aborted ${abortedJobs} active jobs`);
18 }
19 await cancelAllMediaOperations();
20 process.exit(0);
21};
22
23process.on("SIGINT", () => {
24 void shutdown();

Callers 1

index.tsFile · 0.85

Calls 2

abortAllJobsFunction · 0.90
cancelAllMediaOperationsFunction · 0.90

Tested by

no test coverage detected