Merge pull request #801 from embark-framework/bugfix/avoid-multiple-connect
Avoid multiple connect to IPC
This commit is contained in:
commit
a2e03b5b13
|
@ -144,26 +144,28 @@ class Test {
|
||||||
self.engine.startService("codeCoverage");
|
self.engine.startService("codeCoverage");
|
||||||
|
|
||||||
if (self.options.node === 'embark') {
|
if (self.options.node === 'embark') {
|
||||||
return self.engine.ipc.connect((err) => {
|
if (!self.engine.ipc.connected) {
|
||||||
if (err) {
|
self.engine.logger.error("Could not connect to Embark's IPC. Is embark running?");
|
||||||
this.engine.logger.error(err.message || err);
|
|
||||||
this.engine.logger.error("Could not connect to Embark's IPC. Is embark running?");
|
|
||||||
process.exit(1);
|
process.exit(1);
|
||||||
}
|
}
|
||||||
self.engine.ipc.request('blockchain:node', {}, (err, node) => {
|
return self.connectToIpcNode(cb);
|
||||||
if (err) {
|
|
||||||
return self.engine.logger.error(err.message || err);
|
|
||||||
}
|
|
||||||
self.options.node = node;
|
|
||||||
cb();
|
|
||||||
});
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
cb();
|
cb();
|
||||||
}
|
}
|
||||||
], callback);
|
], callback);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
connectToIpcNode(cb) {
|
||||||
|
this.engine.ipc.request('blockchain:node', {}, (err, node) => {
|
||||||
|
if (err) {
|
||||||
|
this.engine.logger.error(err.message || err);
|
||||||
|
return cb();
|
||||||
|
}
|
||||||
|
this.options.node = node;
|
||||||
|
cb();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
onReady(callback) {
|
onReady(callback) {
|
||||||
const self = this;
|
const self = this;
|
||||||
if (this.ready) {
|
if (this.ready) {
|
||||||
|
|
Loading…
Reference in New Issue