From ca5ee91832bf1897a6a8710f516d3ba032448ce6 Mon Sep 17 00:00:00 2001 From: MaksimZhukov Date: Tue, 16 Jun 2020 14:03:26 +0300 Subject: [PATCH] Change RetryCount --- azure-devops/azure-devops-api.ps1 | 17 ++++++----------- azure-devops/run-ci-builds.ps1 | 2 +- 2 files changed, 7 insertions(+), 12 deletions(-) diff --git a/azure-devops/azure-devops-api.ps1 b/azure-devops/azure-devops-api.ps1 index 7d6ee21..b4c35e0 100644 --- a/azure-devops/azure-devops-api.ps1 +++ b/azure-devops/azure-devops-api.ps1 @@ -3,8 +3,8 @@ class AzureDevOpsApi [string] $BaseUrl [string] $RepoOwner [object] $AuthHeader - [UInt32] $RetryCount = 0 - [UInt32] $RetryIntervalSec = 30 + [UInt32] $RetryCount + [UInt32] $RetryIntervalSec AzureDevOpsApi( [string] $TeamFoundationCollectionUri, @@ -15,13 +15,8 @@ class AzureDevOpsApi ) { $this.BaseUrl = $this.BuildBaseUrl($TeamFoundationCollectionUri, $ProjectName) $this.AuthHeader = $this.BuildAuth($AccessToken) - - if ($RetryCount -gt 0) { - $this.RetryCount = $RetryCount - } - if ($RetryIntervalSec -gt 0) { - $this.RetryIntervalSec = $RetryIntervalSec - } + $this.RetryCount = $RetryCount + $this.RetryIntervalSec = $RetryIntervalSec } [object] hidden BuildAuth([string]$AccessToken) { @@ -96,8 +91,8 @@ function Get-AzureDevOpsApi { [string] $TeamFoundationCollectionUri, [string] $ProjectName, [string] $AccessToken, - [UInt32] $RetryCount, - [UInt32] $RetryIntervalSec + [UInt32] $RetryCount = 3, + [UInt32] $RetryIntervalSec = 30 ) return [AzureDevOpsApi]::New($TeamFoundationCollectionUri, $ProjectName, $AccessToken, $RetryCount, $RetryIntervalSec) diff --git a/azure-devops/run-ci-builds.ps1 b/azure-devops/run-ci-builds.ps1 index 9480ef4..349db47 100644 --- a/azure-devops/run-ci-builds.ps1 +++ b/azure-devops/run-ci-builds.ps1 @@ -9,7 +9,7 @@ param ( [Parameter(Mandatory)] [bool] $WaitForBuilds, [string] $ToolVersions, [UInt32] $RetryIntervalSec = 30, - [UInt32] $RetryCount = 20 + [UInt32] $RetryCount = 3 ) Import-Module (Join-Path $PSScriptRoot "azure-devops-api.ps1")