function exitHandler(options: any, err?: any) {
if(exitHandled) {
return;
}
exitHandled = true;
for(let i = 0; i < exitHandlers.length; i++) {
exitHandlers[i]();
}
console.log('process exit');
process.exit();
}
the problem here is that if any of handlers throw an exception, then all other will not be executed.
It should be much more robust if we catch exceptions and log about that
this is how
PrcessService.exitHandler
looks like:the problem here is that if any of handlers throw an exception, then all other will not be executed. It should be much more robust if we catch exceptions and log about that