fix: handle string nodejs signals (#55606)
## Fixing a bug ### What? On these versions, SIGINT signals are `string`, exit callback recieves code `number` ### How? We use code argument to quit process for `event`, and exit with code `0` for `SIGINT` and `SIGTERM` signals Fixes #55605 Co-authored-by: Jiachi Liu <4800338+huozhi@users.noreply.github.com>
This commit is contained in:
parent
7e17de9880
commit
12e888126c
1 changed files with 4 additions and 3 deletions
|
@ -282,9 +282,10 @@ export async function startServer({
|
|||
// This is the render worker, we keep the process alive
|
||||
console.error(err)
|
||||
}
|
||||
process.on('exit', cleanup)
|
||||
process.on('SIGINT', cleanup)
|
||||
process.on('SIGTERM', cleanup)
|
||||
process.on('exit', (code) => cleanup(code))
|
||||
// callback value is signal string, exit with 0
|
||||
process.on('SIGINT', () => cleanup(0))
|
||||
process.on('SIGTERM', () => cleanup(0))
|
||||
process.on('uncaughtException', exception)
|
||||
process.on('unhandledRejection', exception)
|
||||
|
||||
|
|
Loading…
Reference in a new issue