fixed some issues, testing shutdown

This commit is contained in:
Boki 2025-06-20 17:56:45 -04:00
parent dbfa80b2a2
commit 0497541a47
11 changed files with 15 additions and 800 deletions

View file

@ -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);
});