graceful shutdown (#10958)

* graceful shutdown

The main entrypoint now handles the SIGTERM signal and stops the server.

* Don't call process.exit on shutdown

That is not graceful in nodejs, see https://kostasbariotis.com/why-you-should-not-use-process-exit/
This commit is contained in:
Moritz Zwerger
2025-03-16 23:11:09 +01:00
committed by GitHub
parent 834e4e1f96
commit eb14f9b088

View File

@@ -62,4 +62,9 @@ if (fs.existsSync(legacySecretsPath)) {
}
export const server = new Server(config)
process.on('SIGTERM', async () => {
console.log('SIGTERM received, shutting down...')
await server.stop()
})
await server.start()