fix: do not start modules if they are disabled

This commit is contained in:
Jonathan Rainville 2019-10-03 10:28:13 -04:00
parent c54b8d9e44
commit d6bf5c24b9
3 changed files with 9 additions and 0 deletions

View File

@ -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");

View File

@ -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));

View File

@ -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");