Skip to content

Commit 16f5b45

Browse files
pwshBotTravisEz13
andauthored
[release/v7.5] Retry ClearlyDefined operations (#25387)
Co-authored-by: Travis Plunk <travis.plunk@microsoft.com>
1 parent a873b33 commit 16f5b45

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

tools/clearlyDefined/src/ClearlyDefined/ClearlyDefined.psm1

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ function Start-ClearlyDefinedHarvest {
2727
$coordinates = Get-ClearlyDefinedCoordinates @PSBoundParameters
2828
$body = @{tool='package';coordinates=$coordinates} | convertto-json
2929
Write-Verbose $body -Verbose
30-
(Invoke-WebRequest -Method Post -Uri 'https://api.clearlydefined.io/harvest' -Body $body -ContentType 'application/json').Content
30+
(Invoke-WebRequest -Method Post -Uri 'https://api.clearlydefined.io/harvest' -Body $body -ContentType 'application/json' -MaximumRetryCount 5 -RetryIntervalSec 60 -Verbose).Content
3131
}
3232
}
3333

@@ -117,7 +117,7 @@ Function Get-ClearlyDefinedData {
117117
continue
118118
}
119119

120-
Invoke-RestMethod -Uri "https://api.clearlydefined.io/definitions/$coordinates" | ForEach-Object {
120+
Invoke-RestMethod -Uri "https://api.clearlydefined.io/definitions/$coordinates" -MaximumRetryCount 5 -RetryIntervalSec 60 | ForEach-Object {
121121
[bool] $harvested = if ($_.licensed.declared) { $true } else { $false }
122122
Add-Member -NotePropertyName cachedTime -NotePropertyValue (get-date) -InputObject $_ -PassThru | Add-Member -NotePropertyName harvested -NotePropertyValue $harvested -PassThru
123123
if ($_.harvested) {

0 commit comments

Comments
 (0)