Skip to content

Commit

Permalink
Fixing spinner issues
Browse files Browse the repository at this point in the history
Separated spinner objects for main deploy vs qna deploy. Added both to finally statements.  Fixes #8869
  • Loading branch information
dmvtech committed Dec 31, 2021
1 parent 9f03e26 commit a6a7938
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions Provisioning/provisioningComposer.js
Original file line number Diff line number Diff line change
Expand Up @@ -484,7 +484,7 @@ const create = async (
return provisionFailed();
}

// Caste the parameters into the right format
// Cast the parameters into the right format
const deploymentTemplateParam = getDeploymentTemplateParam(
appId,
appPassword,
Expand Down Expand Up @@ -552,6 +552,8 @@ const create = async (
message: getErrorMesssage(err),
});
return provisionFailed();
} finally {
spinner.succeed("Main resources successfully completed");
}

var qnaResult = null;
Expand Down Expand Up @@ -589,7 +591,7 @@ const create = async (
status: BotProjectDeployLoggerType.PROVISION_INFO,
message: `> Deploying QnA Resources (this could take a while)...`,
});
const spinner = ora().start();
const qnaspinner = ora().start();
try {
const qnaDeployment = await createQnADeployment(
client,
Expand All @@ -599,7 +601,7 @@ const create = async (
);
// Handle errors
if (qnaDeployment._response.status != 200) {
spinner.fail();
qnaspinner.fail();
logger({
status: BotProjectDeployLoggerType.PROVISION_ERROR,
message: `! QnA Template is not valid with provided parameters. Review the log for more information.`,
Expand All @@ -615,12 +617,14 @@ const create = async (
return provisionFailed();
}
} catch (err) {
spinner.fail();
qnaspinner.fail();
logger({
status: BotProjectDeployLoggerType.PROVISION_ERROR,
message: getErrorMesssage(err),
});
return provisionFailed();
} finally {
qnaspinner.succeed("QnA resources successfully completed");
}

const qnaDeploymentOutput = await client.deployments.get(resourceGroupName, qnaDeployName);
Expand Down Expand Up @@ -703,7 +707,6 @@ const create = async (
}
}

spinner.succeed('Success!');

// Validate that everything was successfully created.
// Then, update the settings file with information about the new resources
Expand Down

0 comments on commit a6a7938

Please sign in to comment.