зеркало из https://github.com/Azure/vdc.git
added exponential backoff to ARM deployments
This commit is contained in:
Родитель
0fe1cf717b
Коммит
1d23426e2b
|
@ -10,7 +10,7 @@
|
|||
},
|
||||
"Cache": {
|
||||
"Comments": "Caching service",
|
||||
"StorageType": "AzureDevOps"
|
||||
"StorageType": "Local"
|
||||
},
|
||||
"ValidationResourceGroup": {
|
||||
"Name": "vdc-custom-rg",
|
||||
|
|
|
@ -423,7 +423,7 @@ Function Start-ExponentialBackoff () {
|
|||
-ScriptBlock $Expression `
|
||||
-ArgumentList $Arguments;
|
||||
}
|
||||
catch [System.Threading.Tasks.TaskCanceledException] {
|
||||
catch {
|
||||
$newWait = ($i * 60);
|
||||
Write-Debug "Sleeping for: $newWait seconds";
|
||||
Start-Sleep -Seconds ($i * 60);
|
||||
|
@ -432,10 +432,6 @@ Function Start-ExponentialBackoff () {
|
|||
$innerException = Get-Exception -ErrorObject $_;
|
||||
}
|
||||
}
|
||||
catch {
|
||||
Throw `
|
||||
$(Get-Exception -ErrorObject $_);
|
||||
}
|
||||
}
|
||||
|
||||
throw "Maximum number of retries reached. Number of retries: $MaxRetries. InnerException: $innerException";
|
||||
|
|
|
@ -186,12 +186,15 @@ Class AzureResourceManagerDeploymentService: IDeploymentService {
|
|||
|
||||
# Call REST API to start the deployment
|
||||
$deployment = `
|
||||
Invoke-RestMethod `
|
||||
-Method $method `
|
||||
-Uri $uri `
|
||||
-Body $requestBody `
|
||||
-Headers $headers `
|
||||
-ContentType "application/json";
|
||||
Start-ExponentialBackoff `
|
||||
-Expression { `
|
||||
Invoke-RestMethod `
|
||||
-Method $method `
|
||||
-Uri $uri `
|
||||
-Body $requestBody `
|
||||
-Headers $headers `
|
||||
-ContentType "application/json"; }
|
||||
|
||||
|
||||
Write-Debug "Result of ARM Invocation is: $(ConvertTo-Json $deployment -Depth 50)";
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче