feat: add graceful shutdown handlers for SIGINT and SIGTERM
This commit is contained in:
10
server.ts
10
server.ts
@@ -546,6 +546,16 @@ async function initializeServer() {
|
||||
}
|
||||
})
|
||||
|
||||
process.on('SIGINT', () => {
|
||||
log.info('Shutting down server...')
|
||||
server.stop()
|
||||
})
|
||||
|
||||
process.on('SIGTERM', () => {
|
||||
log.info('Shutting down server...')
|
||||
server.stop()
|
||||
})
|
||||
|
||||
log.success(`Server listening on http://localhost:${String(server.port)}`)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user