[f] Fix for #971 - "Fatal error when Ethereum node going offline".
[a] Added .once() into Events.
This commit is contained in:
parent
08c140b035
commit
f41bcd55d6
|
@ -286,7 +286,7 @@ class EmbarkController {
|
|||
engine.startService("namingSystem");
|
||||
engine.startService("console");
|
||||
engine.startService("pluginCommand");
|
||||
engine.events.on('check:backOnline:Ethereum', () => callback());
|
||||
engine.events.once('check:backOnline:Ethereum', () => callback());
|
||||
},
|
||||
function ipcConnect(callback) {
|
||||
// Do specific work in case we are connected to a socket:
|
||||
|
|
|
@ -19,6 +19,7 @@ function log(eventType, eventName) {
|
|||
|
||||
EventEmitter.prototype._maxListeners = 350;
|
||||
const _on = EventEmitter.prototype.on;
|
||||
const _once = EventEmitter.prototype.once;
|
||||
const _setHandler = EventEmitter.prototype.setHandler;
|
||||
|
||||
EventEmitter.prototype.on = function(requestName, cb) {
|
||||
|
@ -27,6 +28,12 @@ EventEmitter.prototype.on = function(requestName, cb) {
|
|||
return _on.call(this, requestName, cb);
|
||||
};
|
||||
|
||||
EventEmitter.prototype.once = function(requestName, cb) {
|
||||
log("listening to event (once): ", requestName);
|
||||
warnIfLegacy(requestName);
|
||||
return _once.call(this, requestName, cb);
|
||||
};
|
||||
|
||||
EventEmitter.prototype.setHandler = function(requestName, cb) {
|
||||
log("setting handler for: ", requestName);
|
||||
warnIfLegacy(requestName);
|
||||
|
|
Loading…
Reference in New Issue