mirror of
https://github.com/gosticks/plane.git
synced 2025-10-16 12:45:33 +00:00
[WIKI-704] fix: disable exiting on unhandled rejection/exception #7902
This commit is contained in:
parent
269fc0d9e0
commit
431af01483
@ -18,26 +18,26 @@ startServer();
|
||||
|
||||
// Graceful shutdown on unhandled rejection
|
||||
process.on("unhandledRejection", async (err: Error) => {
|
||||
logger.error(`UNHANDLED REJECTION! 💥 Shutting down...`, err);
|
||||
logger.error(`UNHANDLED REJECTION!`, err);
|
||||
try {
|
||||
if (server) {
|
||||
await server.destroy();
|
||||
}
|
||||
// if (server) {
|
||||
// await server.destroy();
|
||||
// }
|
||||
} finally {
|
||||
logger.info("Exiting process...");
|
||||
process.exit(1);
|
||||
// logger.info("Exiting process...");
|
||||
// process.exit(1);
|
||||
}
|
||||
});
|
||||
|
||||
// Graceful shutdown on uncaught exception
|
||||
process.on("uncaughtException", async (err: Error) => {
|
||||
logger.error(`UNCAUGHT EXCEPTION! 💥 Shutting down...`, err);
|
||||
logger.error(`UNCAUGHT EXCEPTION!`, err);
|
||||
try {
|
||||
if (server) {
|
||||
await server.destroy();
|
||||
}
|
||||
// if (server) {
|
||||
// await server.destroy();
|
||||
// }
|
||||
} finally {
|
||||
logger.info("Exiting process...");
|
||||
process.exit(1);
|
||||
// logger.info("Exiting process...");
|
||||
// process.exit(1);
|
||||
}
|
||||
});
|
||||
|
||||
Loading…
Reference in New Issue
Block a user