()
| 4762 | |
| 4763 | let shuttingDown = false; |
| 4764 | const shutdown = async () => { |
| 4765 | if (shuttingDown) return; |
| 4766 | shuttingDown = true; |
| 4767 | // Stop accepting new connections before tearing down sessions. |
| 4768 | server.stop(true); |
| 4769 | await sessionManager.destroyAll(); |
| 4770 | await removeServerLock(); |
| 4771 | process.exit(0); |
| 4772 | }; |
| 4773 | process.once('SIGINT', () => void shutdown()); |
| 4774 | process.once('SIGTERM', () => void shutdown()); |
| 4775 | }, |
no test coverage detected