()
| 9 | let shuttingDown = false; |
| 10 | |
| 11 | const 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 | |
| 23 | process.on("SIGINT", () => { |
| 24 | void shutdown(); |
no test coverage detected