Skip to content

Commit

Permalink
Fixed bug with wait time refactor. Tested manually, unit tests to fol…
Browse files Browse the repository at this point in the history
…low in a follow-up PR. (#375)
  • Loading branch information
banaag authored Nov 19, 2019
1 parent fd02f1a commit 4945755
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions packager/certcache/certcache.go
Original file line number Diff line number Diff line change
Expand Up @@ -375,13 +375,14 @@ func (this *CertCache) readOCSP(allowRetries bool) ([]byte, time.Time, error) {
for numTries := 0; numTries < maxTries; {
ocsp, ocspUpdateAfter, err = this.readOCSPHelper(numTries, numTries >= maxTries - 1)
if err != nil {
if numTries >= maxTries - 1 {
return nil, ocspUpdateAfter, err
} else {
numTries++
waitTimeInMinutes = waitForSpecifiedTime(waitTimeInMinutes, numTries)
continue
}
return nil, ocspUpdateAfter, err
}
if !this.shouldUpdateOCSP(ocsp) {
break;
}
// Wait only if are not on our last try.
if numTries < maxTries - 1 {
waitTimeInMinutes = waitForSpecifiedTime(waitTimeInMinutes, numTries)
}
numTries++
}
Expand Down

0 comments on commit 4945755

Please sign in to comment.