Skip to content

Commit

Permalink
Reduce the number of retries and shorten the sleep interval to impact…
Browse files Browse the repository at this point in the history
… air-gapped environments less

Signed-off-by: Aram Price <[email protected]>
  • Loading branch information
ystros authored and aramprice committed Sep 12, 2023
1 parent 50fe88d commit a7fbc97
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions modules/BOSH.Utils/BOSH.Utils.psm1
Original file line number Diff line number Diff line change
Expand Up @@ -362,9 +362,8 @@ function Invoke-Certutil {
[Parameter(Mandatory=$True)]
[string]$generateSSTFromWU
)
# We balance number of retries against unnecessarily slowing down air-grapped envs
# 595 seconds is one standard deviation for intervals of failed certutils;
$NumberOfRetries = 20 # One standard deviation (30 seconds * 20 retries = 600)
# We balance number of retries against unnecessarily slowing down air-gapped envs
$NumberOfRetries = 10
$i = 0
while ($i -lt $NumberOfRetries) {
$Result = Invoke-Command -ScriptBlock { certutil -generateSSTFromWU $generateSSTFromWU }
Expand All @@ -375,7 +374,7 @@ function Invoke-Certutil {
}

Write-Host "Error generating cert file from windows update server. Retry #$i $Result"
Start-Sleep -Seconds 30
Start-Sleep -Seconds 5
$i++
}
if ($LASTEXITCODE -ne 0) {
Expand Down

0 comments on commit a7fbc97

Please sign in to comment.