Do not hang if process crash

This commit is contained in:
Anthony Laibe 2018-08-16 15:01:48 +01:00 committed by Iuri Matias
parent b9cd0cf74e
commit b3ed3d0379
2 changed files with 8 additions and 0 deletions

View File

@ -29,6 +29,10 @@ class ProcessLauncher {
_subscribeToMessages() {
const self = this;
this.process.on('message', (msg) => {
if (msg.error) {
self.logger.error(msg.error);
process.exit(0);
}
if (msg.result === constants.process.log) {
return self._handleLog(msg);
}

View File

@ -1,3 +1,7 @@
process.on('uncaughtException', function(e){
process.send({error: e.stack});
});
const constants = require('../../constants');
const Events = require('./eventsWrapper');