mirror of
https://github.com/Unitech/pm2.git
synced 2025-12-08 20:35:53 +00:00
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:
commit
f29ecc8ff0
@ -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 });
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user