mirror of https://github.com/embarklabs/embark.git
fix: do not start modules if they are disabled
This commit is contained in:
parent
c54b8d9e44
commit
d6bf5c24b9
|
@ -16,6 +16,9 @@ class Communication {
|
||||||
});
|
});
|
||||||
|
|
||||||
this.events.setCommandHandler("communication:node:start", (communicationConfig, cb) => {
|
this.events.setCommandHandler("communication:node:start", (communicationConfig, cb) => {
|
||||||
|
if (!communicationConfig.enabled) {
|
||||||
|
return cb();
|
||||||
|
}
|
||||||
const clientName = communicationConfig.provider;
|
const clientName = communicationConfig.provider;
|
||||||
const client = this.communicationNodes[clientName];
|
const client = this.communicationNodes[clientName];
|
||||||
if (!client) return cb("communication " + clientName + " not found");
|
if (!client) return cb("communication " + clientName + " not found");
|
||||||
|
|
|
@ -17,6 +17,9 @@ export default class Namesystem {
|
||||||
});
|
});
|
||||||
|
|
||||||
this.events.setCommandHandler("namesystem:node:start", (namesystemConfig, cb) => {
|
this.events.setCommandHandler("namesystem:node:start", (namesystemConfig, cb) => {
|
||||||
|
if (!namesystemConfig.enabled) {
|
||||||
|
return cb();
|
||||||
|
}
|
||||||
const nodeName = namesystemConfig.provider;
|
const nodeName = namesystemConfig.provider;
|
||||||
const client = this.namesystemNodes[nodeName];
|
const client = this.namesystemNodes[nodeName];
|
||||||
if (!client) return cb(__("Namesystem client %s not found", nodeName));
|
if (!client) return cb(__("Namesystem client %s not found", nodeName));
|
||||||
|
|
|
@ -16,6 +16,9 @@ class Storage {
|
||||||
});
|
});
|
||||||
|
|
||||||
this.events.setCommandHandler("storage:node:start", (storageConfig, cb) => {
|
this.events.setCommandHandler("storage:node:start", (storageConfig, cb) => {
|
||||||
|
if (!storageConfig.enabled) {
|
||||||
|
return cb();
|
||||||
|
}
|
||||||
const clientName = storageConfig.upload.provider;
|
const clientName = storageConfig.upload.provider;
|
||||||
const client = this.storageNodes[clientName];
|
const client = this.storageNodes[clientName];
|
||||||
if (!client) return cb("storage " + clientName + " not found");
|
if (!client) return cb("storage " + clientName + " not found");
|
||||||
|
|
Loading…
Reference in New Issue