diff options
| author | Hazelnoot <acomputerdog@gmail.com> | 2025-06-12 21:37:28 -0400 |
|---|---|---|
| committer | Hazelnoot <acomputerdog@gmail.com> | 2025-06-12 21:37:28 -0400 |
| commit | 3ce547141453960c6d15a63de21f6a89d2a7258c (patch) | |
| tree | 2cbaf819fe537f4d4209bf38ea018abc877172a5 /packages/backend/src/boot | |
| parent | use uncaughtExceptionMonitor instead uncaughtException (diff) | |
| download | sharkey-3ce547141453960c6d15a63de21f6a89d2a7258c.tar.gz sharkey-3ce547141453960c6d15a63de21f6a89d2a7258c.tar.bz2 sharkey-3ce547141453960c6d15a63de21f6a89d2a7258c.zip | |
add additional process exit loggers
Diffstat (limited to 'packages/backend/src/boot')
| -rw-r--r-- | packages/backend/src/boot/entry.ts | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/packages/backend/src/boot/entry.ts b/packages/backend/src/boot/entry.ts index 9a830403e7..afb48e526c 100644 --- a/packages/backend/src/boot/entry.ts +++ b/packages/backend/src/boot/entry.ts @@ -73,8 +73,26 @@ async function main() { })); // Dying away... + process.on('disconnect', () => { + try { + logger.warn('IPC channel disconnected! The process may soon die.'); + } catch { + console.warn('IPC channel disconnected! The process may soon die.'); + } + }); + process.on('beforeExit', code => { + try { + logger.warn(`Event loop died! Process will exit with code ${code}.`); + } catch { + console.warn(`Event loop died! Process will exit with code ${code}.`); + } + }); process.on('exit', code => { - logger.info(`The process is going to exit with code ${code}`); + try { + logger.info(`The process is going to exit with code ${code}`); + } catch { + console.info(`The process is going to exit with code ${code}`); + } }); //#endregion |