@@ -58,7 +58,7 @@ const ocspCheckInterval = 1 * time.Hour
58
58
const certCheckInterval = 24 * time .Hour
59
59
60
60
// Max number of OCSP request tries.
61
- // This will timeout after 2^ 10 minutes or ~16 hours .
61
+ // This will timeout after 1 + 2 + 4 + 8 + 10 * 6 = 75 minutes .
62
62
const maxOCSPTries = 10
63
63
64
64
// Recommended renewal duration for certs. This is duration before next cert expiry.
@@ -108,7 +108,7 @@ type CertCache struct {
108
108
// Callers can use the uninitialized CertCache for testing certificates (without doing OCSP or
109
109
// cert refreshes).
110
110
//
111
- // TODO(banaag): per greigable @ comments:
111
+ // TODO(banaag): per gregable @ comments:
112
112
// The long argument list makes the callsites tricky to read and easy to get wrong, especially if several of the arguments have the same type.
113
113
//
114
114
// An alternative pattern would be to create an IsInitialized() bool or similarly named function that verifies all of the required fields have
@@ -358,13 +358,6 @@ func (this *CertCache) readOCSPHelper(numTries int, exhaustedRetries bool) ([]by
358
358
}
359
359
360
360
// Returns the OCSP response and expiry, refreshing if necessary.
361
- // TODO(banaag): Per twifkak's suggestion, consider:
362
- // It may also be interesting to try to separate the retry logic from the fetch logic. One approach comes to mind:
363
- //
364
- // retryWithBackoff(func() {
365
- // ocsp, err := ...
366
- // return true if successful
367
- // }, initialWaitTime, maxTries)
368
361
func (this * CertCache ) readOCSP (allowRetries bool ) ([]byte , time.Time , error ) {
369
362
var ocspUpdateAfter time.Time
370
363
var err error
0 commit comments