File tree Expand file tree Collapse file tree 1 file changed +15
-4
lines changed
src/ResourceManager/Resources/Commands.ResourceManager/Cmdlets/SdkClient Expand file tree Collapse file tree 1 file changed +15
-4
lines changed Original file line number Diff line number Diff line change @@ -313,20 +313,31 @@ private DeploymentExtended WaitDeploymentStatus(
313
313
params ProvisioningState [ ] status )
314
314
{
315
315
DeploymentExtended deployment ;
316
- int counter = 5000 ;
316
+
317
+ // Poll deployment state and deployment operations with two phases. In phase one, poll every 5 seconds. Phase one
318
+ // takes 400 seconds. In phase two, poll every 60 seconds.
319
+ const int counterUnit = 1000 ;
320
+ int step = 5 ;
321
+ int phaseOne = 400 ;
317
322
318
323
do
319
324
{
320
- WriteVerbose ( string . Format ( ProjectResources . CheckingDeploymentStatus , counter / 1000 ) ) ;
321
- TestMockSupport . Delay ( counter ) ;
325
+ WriteVerbose ( string . Format ( ProjectResources . CheckingDeploymentStatus , step ) ) ;
326
+ TestMockSupport . Delay ( step * counterUnit ) ;
327
+
328
+ if ( phaseOne > 0 )
329
+ {
330
+ phaseOne -= step ;
331
+ }
322
332
323
333
if ( job != null )
324
334
{
325
335
job ( resourceGroup , deploymentName , basicDeployment ) ;
326
336
}
327
337
328
338
deployment = ResourceManagementClient . Deployments . Get ( resourceGroup , deploymentName ) ;
329
- counter = counter + 5000 > 60000 ? 60000 : counter + 5000 ;
339
+
340
+ step = phaseOne > 0 ? 5 : 60 ;
330
341
331
342
} while ( ! status . Any ( s => s . ToString ( ) . Equals ( deployment . Properties . ProvisioningState , StringComparison . OrdinalIgnoreCase ) ) ) ;
332
343
You can’t perform that action at this time.
0 commit comments