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(
313313 params ProvisioningState [ ] status )
314314 {
315315 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 ;
317322
318323 do
319324 {
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+ }
322332
323333 if ( job != null )
324334 {
325335 job ( resourceGroup , deploymentName , basicDeployment ) ;
326336 }
327337
328338 deployment = ResourceManagementClient . Deployments . Get ( resourceGroup , deploymentName ) ;
329- counter = counter + 5000 > 60000 ? 60000 : counter + 5000 ;
339+
340+ step = phaseOne > 0 ? 5 : 60 ;
330341
331342 } while ( ! status . Any ( s => s . ToString ( ) . Equals ( deployment . Properties . ProvisioningState , StringComparison . OrdinalIgnoreCase ) ) ) ;
332343
You can’t perform that action at this time.
0 commit comments