private async Task <DeploymentStatus> WaitForDeployment(RestAPIClient restApiClient, string sessionId) { // Do an initial delay to avoid a race condition of the status being checked before the deployment has kicked off. await Task.Delay(TimeSpan.FromSeconds(3)); await WaitUntilHelper.WaitUntil(async() => { DeploymentStatus status = (await restApiClient.GetDeploymentStatusAsync(sessionId)).Status;; return(status != DeploymentStatus.Executing); }, TimeSpan.FromSeconds(1), TimeSpan.FromMinutes(15)); return((await restApiClient.GetDeploymentStatusAsync(sessionId)).Status); }
private async Task WaitTillServerModeReady(RestAPIClient restApiClient) { await WaitUntilHelper.WaitUntil(async() => { SystemStatus status = SystemStatus.Error; try { status = (await restApiClient.HealthAsync()).Status; } catch (Exception) { } return(status == SystemStatus.Ready); }, TimeSpan.FromSeconds(1), TimeSpan.FromSeconds(10)); }