fixed some issues, testing shutdown
This commit is contained in:
parent
dbfa80b2a2
commit
0497541a47
11 changed files with 15 additions and 800 deletions
|
|
@ -125,6 +125,7 @@ export class Shutdown {
|
|||
}
|
||||
|
||||
// Don't call process.exit here - let the caller decide
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
|
|
@ -171,7 +172,8 @@ export class Shutdown {
|
|||
process.platform === 'win32' ? ['SIGINT', 'SIGTERM'] : ['SIGTERM', 'SIGINT', 'SIGUSR2'];
|
||||
|
||||
signals.forEach(signal => {
|
||||
process.once(signal, () => { // Changed from 'on' to 'once' to prevent multiple handlers
|
||||
process.once(signal, () => {
|
||||
// Changed from 'on' to 'once' to prevent multiple handlers
|
||||
this.shutdownAndExit(signal).catch(() => {
|
||||
process.exit(1);
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue