Skip to content

Fixing the infinite loop issue #245

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 7, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ public override void ExecuteCmdlet()
CollectionUsageDetailsResult detailsUsage = null;
string locale = String.Empty;
RemoteAppOperationStatusResult operationResult = null;
int maxRetryCount = 600;
int maxRetryCount = 60;

if (String.IsNullOrWhiteSpace(UsageMonth))
{
Expand All @@ -77,12 +77,13 @@ public override void ExecuteCmdlet()
// The request is async and we have to wait for the usage details to be produced here
do
{

System.Threading.Thread.Sleep(5000);

operationResult = CallClient(() => Client.OperationResults.Get(detailsUsage.UsageDetails.OperationTrackingId), Client.OperationResults);
}
while(operationResult.RemoteAppOperationResult.Status != RemoteAppOperationStatus.Success ||
operationResult.RemoteAppOperationResult.Status != RemoteAppOperationStatus.Failed ||
while(operationResult.RemoteAppOperationResult.Status != RemoteAppOperationStatus.Success &&
operationResult.RemoteAppOperationResult.Status != RemoteAppOperationStatus.Failed &&
--maxRetryCount > 0);

if (operationResult.RemoteAppOperationResult.Status == RemoteAppOperationStatus.Success)
Expand All @@ -104,7 +105,9 @@ public override void ExecuteCmdlet()
else if (maxRetryCount <= 0)
{
ErrorRecord error = RemoteAppCollectionErrorState.CreateErrorRecordFromString(
Commands_RemoteApp.RequestTimedOut,
String.Format(System.Globalization.CultureInfo.InvariantCulture,
Commands_RemoteApp.RequestTimedOutFormat,
detailsUsage.UsageDetails.OperationTrackingId),
String.Empty,
Client.Collections,
ErrorCategory.OperationTimeout);
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -177,8 +177,8 @@
<data name="NoVmImageFoundErrorFormat" xml:space="preserve">
<value>No VM image found with name {0}.</value>
</data>
<data name="RequestTimedOut" xml:space="preserve">
<value>Request timed out</value>
<data name="RequestTimedOutFormat" xml:space="preserve">
<value>Request timed out. To continue querying for the usage details operation status, please use Get-AzureRemoteAppOperationResult with tracking id: {0}</value>
</data>
<data name="SessionLogOffCaptionMessage" xml:space="preserve">
<value>Logging off user session...</value>
Expand Down