fix(core.gbapp): Boot process fully tested.

This commit is contained in:
Rodrigo Rodriguez 2021-04-22 12:12:05 -03:00
parent 657dd0b849
commit a6d1f90bbf
3 changed files with 51 additions and 32 deletions

View file

@ -170,7 +170,7 @@ export class GBAdminService implements IGBAdminService {
}
public static isSharePointPath(path: string) {
return path.indexOf('sharepoint.com') > 0;
return path.indexOf('sharepoint.com') !== -1;
}
public static async deployPackageCommand(min: GBMinInstance, text: string, deployer: IGBDeployer) {
const packageName = text.split(' ')[1];

View file

@ -853,6 +853,10 @@ export class AzureDeployerService implements IGBInstallationDeployer {
}
private async createServer(farmId, group, name, location) {
let tryed = false;
const create = async () => {
const parameters: Site = {
location: location,
serverFarmId: farmId,
@ -881,8 +885,23 @@ export class AzureDeployerService implements IGBInstallationDeployer {
};
await this.webSiteClient.webApps.createOrUpdateSourceControl(group, name, souceControlConfig);
return server;
};
try {
return await create();
} catch (e) {
if (!tryed) {
tryed = true;
GBLog.info('Retrying Deploying Bot Server...');
try {
return await create();
} catch (error) {
GBLog.info('Server creation failed at all on MSAzure, stopping...');
throw error;
}
}
}
}
private async updateWebisteConfig(group, name, serverFarmId, instance: IGBInstance) {

View file

@ -635,7 +635,7 @@ export class GBMinService {
// If there is WhatsApp configuration specified, initialize
// infrastructure objects.
if (min.instance.whatsappServiceUrl !== null) {
if (min.instance.whatsappServiceUrl) {
min.whatsAppDirectLine = new WhatsappDirectLine(
min,
min.botId,