fix(core.gbapp): Entire Web stack is optional now.

This commit is contained in:
Rodrigo Rodriguez 2020-04-02 22:02:50 -03:00
parent b6e3611636
commit 9652fcdb0b
3 changed files with 15 additions and 10 deletions

View file

@ -131,12 +131,15 @@ export class GBConfigService {
value = 'true'; value = 'true';
break; break;
case 'REVERSE_PROXY': case 'REVERSE_PROXY':
value = undefined; value = undefined;
break; break;
case 'DISABLE_WEB':
value = "false";
break;
case 'STORAGE_ACQUIRE_TIMEOUT': case 'STORAGE_ACQUIRE_TIMEOUT':
value = 40000; value = 40000;
break; break;
default: default:
GBLog.warn(`Invalid key on .env file: '${key}'`); GBLog.warn(`Invalid key on .env file: '${key}'`);
break; break;
} }

View file

@ -63,7 +63,7 @@ export class GBImporter {
} }
const instance = await this.core.loadInstance(botId); const instance = await this.core.loadInstance(botId);
if (instance != null || instance.botId === null) { if (instance != null && instance.botId === null) {
console.log(`Null BotId after load instance with botId: ${botId}.`); console.log(`Null BotId after load instance with botId: ${botId}.`);
} }

View file

@ -167,7 +167,7 @@ export class GBServer {
const fullInstance = Object.assign(packageInstance, GBServer.globals.bootInstance); const fullInstance = Object.assign(packageInstance, GBServer.globals.bootInstance);
await core.saveInstance(fullInstance); await core.saveInstance(fullInstance);
let instances: IGBInstance[] = await core.loadAllInstances(core, azureDeployer, let instances: IGBInstance[] = await core.loadAllInstances(core, azureDeployer,
GBServer.globals.publicAddress); GBServer.globals.publicAddress);
instances = await core.ensureInstances(instances, GBServer.globals.bootInstance, core); instances = await core.ensureInstances(instances, GBServer.globals.bootInstance, core);
if (GBServer.globals.bootInstance !== undefined) { if (GBServer.globals.bootInstance !== undefined) {
GBServer.globals.bootInstance = instances[0]; GBServer.globals.bootInstance = instances[0];
@ -182,7 +182,9 @@ export class GBServer {
// Deployment of local applications for the first time. // Deployment of local applications for the first time.
deployer.setupDefaultGBUI(); if (GBConfigService.get("DISABLE_WEB") !== "true") {
deployer.setupDefaultGBUI();
}
GBLog.info(`The Bot Server is in RUNNING mode...`); GBLog.info(`The Bot Server is in RUNNING mode...`);