mirror of
https://github.com/badges/shields.git
synced 2025-04-18 19:44: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:
parent
834e4e1f96
commit
eb14f9b088
@ -62,4 +62,9 @@ if (fs.existsSync(legacySecretsPath)) {
|
|||||||
}
|
}
|
||||||
export const server = new Server(config)
|
export const server = new Server(config)
|
||||||
|
|
||||||
|
process.on('SIGTERM', async () => {
|
||||||
|
console.log('SIGTERM received, shutting down...')
|
||||||
|
await server.stop()
|
||||||
|
})
|
||||||
|
|
||||||
await server.start()
|
await server.start()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user