1
0
mirror of https://github.com/badges/shields.git synced 2025-04-17 08:37:04 +03:00

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
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

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()