Skip to content

Commit edbc7d2

Browse files
committed
Merge pull request #245 from yadavbdev/release-0.8.15
Fixing the infinite loop issue
2 parents 14fee64 + 6553253 commit edbc7d2

File tree

3 files changed

+12
-9
lines changed

3 files changed

+12
-9
lines changed

src/ServiceManagement/RemoteApp/Commands.RemoteApp/Collection/GetAzureRemoteAppCollectionUsageDetails.cs

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ public override void ExecuteCmdlet()
5353
CollectionUsageDetailsResult detailsUsage = null;
5454
string locale = String.Empty;
5555
RemoteAppOperationStatusResult operationResult = null;
56-
int maxRetryCount = 600;
56+
int maxRetryCount = 60;
5757

5858
if (String.IsNullOrWhiteSpace(UsageMonth))
5959
{
@@ -77,12 +77,13 @@ public override void ExecuteCmdlet()
7777
// The request is async and we have to wait for the usage details to be produced here
7878
do
7979
{
80+
8081
System.Threading.Thread.Sleep(5000);
8182

8283
operationResult = CallClient(() => Client.OperationResults.Get(detailsUsage.UsageDetails.OperationTrackingId), Client.OperationResults);
8384
}
84-
while(operationResult.RemoteAppOperationResult.Status != RemoteAppOperationStatus.Success ||
85-
operationResult.RemoteAppOperationResult.Status != RemoteAppOperationStatus.Failed ||
85+
while(operationResult.RemoteAppOperationResult.Status != RemoteAppOperationStatus.Success &&
86+
operationResult.RemoteAppOperationResult.Status != RemoteAppOperationStatus.Failed &&
8687
--maxRetryCount > 0);
8788

8889
if (operationResult.RemoteAppOperationResult.Status == RemoteAppOperationStatus.Success)
@@ -104,7 +105,9 @@ public override void ExecuteCmdlet()
104105
else if (maxRetryCount <= 0)
105106
{
106107
ErrorRecord error = RemoteAppCollectionErrorState.CreateErrorRecordFromString(
107-
Commands_RemoteApp.RequestTimedOut,
108+
String.Format(System.Globalization.CultureInfo.InvariantCulture,
109+
Commands_RemoteApp.RequestTimedOutFormat,
110+
detailsUsage.UsageDetails.OperationTrackingId),
108111
String.Empty,
109112
Client.Collections,
110113
ErrorCategory.OperationTimeout);

src/ServiceManagement/RemoteApp/Commands.RemoteApp/Commands.RemoteApp.Designer.cs

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/ServiceManagement/RemoteApp/Commands.RemoteApp/Commands.RemoteApp.resx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -177,8 +177,8 @@
177177
<data name="NoVmImageFoundErrorFormat" xml:space="preserve">
178178
<value>No VM image found with name {0}.</value>
179179
</data>
180-
<data name="RequestTimedOut" xml:space="preserve">
181-
<value>Request timed out</value>
180+
<data name="RequestTimedOutFormat" xml:space="preserve">
181+
<value>Request timed out. To continue querying for the usage details operation status, please use Get-AzureRemoteAppOperationResult with tracking id: {0}</value>
182182
</data>
183183
<data name="SessionLogOffCaptionMessage" xml:space="preserve">
184184
<value>Logging off user session...</value>

0 commit comments

Comments
 (0)