fix(all): Fixes in bot creation.

This commit is contained in:
Rodrigo Rodriguez 2023-12-29 19:14:48 -03:00
parent e45c25cf3e
commit 2dc6e327e8

View file

@ -161,10 +161,12 @@ export class GBServer {
// Creates a boot instance or load it from storage. // Creates a boot instance or load it from storage.
let runOnce = false;
if (GBConfigService.get('STORAGE_SERVER')) { if (GBConfigService.get('STORAGE_SERVER')) {
azureDeployer = await AzureDeployerService.createInstance(deployer); azureDeployer = await AzureDeployerService.createInstance(deployer);
await core.initStorage(); await core.initStorage();
} else { } else {
runOnce = true;
[GBServer.globals.bootInstance, azureDeployer] = await core['createBootInstanceEx']( [GBServer.globals.bootInstance, azureDeployer] = await core['createBootInstanceEx'](
core, core,
null, null,
@ -185,6 +187,10 @@ export class GBServer {
await deployer.deployPackages(core, server, GBServer.globals.appPackages); await deployer.deployPackages(core, server, GBServer.globals.appPackages);
await core.syncDatabaseStructure(); await core.syncDatabaseStructure();
if (runOnce){
await core.saveInstance(GBServer.globals.bootInstance);
}
// Deployment of local applications for the first time. // Deployment of local applications for the first time.
if (GBConfigService.get('DISABLE_WEB') !== 'true') { if (GBConfigService.get('DISABLE_WEB') !== 'true') {