fix: process awake from sleeping
This commit is contained in:
parent
f3db779eb9
commit
2bac20f2e4
|
|
@ -358,6 +358,7 @@ Monitor.prototype._startWatching = function(){
|
|||
this._throttleRefresh();
|
||||
}.bind(this));
|
||||
|
||||
// Enforce a refresh operation if RPC is not online.
|
||||
this._throttleRefresh();
|
||||
};
|
||||
|
||||
|
|
|
|||
15
lib/pm.js
15
lib/pm.js
|
|
@ -26,9 +26,18 @@ pm.sub = function(sockPath, cb){
|
|||
var sub = axon.socket('sub-emitter'),
|
||||
sub_sock = sub.connect(sockPath);
|
||||
|
||||
sub.on('process:*', function(event, data){
|
||||
if (data && !!~allowedEvents.indexOf(data.event)) {
|
||||
cb(data);
|
||||
// Once awake from sleeping.
|
||||
sub.on('log:*', function(e, d){
|
||||
// Do not subscribe it.
|
||||
sub.off('log:*');
|
||||
d.event = 'awake';
|
||||
cb(d);
|
||||
});
|
||||
|
||||
// Process events.
|
||||
sub.on('process:*', function(e, d){
|
||||
if (d && !!~allowedEvents.indexOf(d.event)) {
|
||||
cb(d);
|
||||
}
|
||||
});
|
||||
};
|
||||
|
|
|
|||
Loading…
Reference in New Issue