Skip to content

Commit 4945755

Browse files
authored
Fixed bug with wait time refactor. Tested manually, unit tests to follow in a follow-up PR. (#375)
1 parent fd02f1a commit 4945755

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

packager/certcache/certcache.go

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -375,13 +375,14 @@ func (this *CertCache) readOCSP(allowRetries bool) ([]byte, time.Time, error) {
375375
for numTries := 0; numTries < maxTries; {
376376
ocsp, ocspUpdateAfter, err = this.readOCSPHelper(numTries, numTries >= maxTries - 1)
377377
if err != nil {
378-
if numTries >= maxTries - 1 {
379-
return nil, ocspUpdateAfter, err
380-
} else {
381-
numTries++
382-
waitTimeInMinutes = waitForSpecifiedTime(waitTimeInMinutes, numTries)
383-
continue
384-
}
378+
return nil, ocspUpdateAfter, err
379+
}
380+
if !this.shouldUpdateOCSP(ocsp) {
381+
break;
382+
}
383+
// Wait only if are not on our last try.
384+
if numTries < maxTries - 1 {
385+
waitTimeInMinutes = waitForSpecifiedTime(waitTimeInMinutes, numTries)
385386
}
386387
numTries++
387388
}

0 commit comments

Comments
 (0)