Merge pull request #229 from bpostlethwaite/add-pm2ID-to-Bus

add pm2_id to external msgs to link msg to sending process
This commit is contained in:
Alexandre Strzelewicz 2013-12-26 06:30:20 -08:00
commit f29ecc8ff0

View File

@ -114,7 +114,7 @@ function nodeApp(pm2_env, cb){
clu.on('message', function(msg) {
switch (msg.type) {
case 'uncaughtException':
God.bus.emit('process:exception', {process : clu, msg : msg.stack, err : msg.err});
God.bus.emit('process:exception', {process : clu, data : msg.stack, err : msg.err});
break;
case 'log:out':
God.bus.emit('log:out', {process : clu, data : msg.data});
@ -123,7 +123,7 @@ function nodeApp(pm2_env, cb){
God.bus.emit('log:err', {process : clu, data : msg.data});
break;
default: // Permits to send message to external from the app
God.bus.emit(msg.type ? msg.type : 'msg', msg);
God.bus.emit(msg.type ? msg.type : 'process:msg', {process : clu, data : msg });
}
});