Make crl-updater deadline setting clearer (#8027)
Rather than using context.WithTimeout to magically convert a timeout to a deadline for us, compute the deadline ourselves and then set it directly on the context.
This commit is contained in:
parent
f6702fffe8
commit
10d9ef9af7
|
|
@ -138,9 +138,9 @@ func NewUpdater(
|
||||||
// updateShardWithRetry calls updateShard repeatedly (with exponential backoff
|
// updateShardWithRetry calls updateShard repeatedly (with exponential backoff
|
||||||
// between attempts) until it succeeds or the max number of attempts is reached.
|
// between attempts) until it succeeds or the max number of attempts is reached.
|
||||||
func (cu *crlUpdater) updateShardWithRetry(ctx context.Context, atTime time.Time, issuerNameID issuance.NameID, shardIdx int, chunks []chunk) error {
|
func (cu *crlUpdater) updateShardWithRetry(ctx context.Context, atTime time.Time, issuerNameID issuance.NameID, shardIdx int, chunks []chunk) error {
|
||||||
ctx, cancel := context.WithTimeout(ctx, cu.updateTimeout)
|
deadline := cu.clk.Now().Add(cu.updateTimeout)
|
||||||
|
ctx, cancel := context.WithDeadline(ctx, deadline)
|
||||||
defer cancel()
|
defer cancel()
|
||||||
deadline, _ := ctx.Deadline()
|
|
||||||
|
|
||||||
if chunks == nil {
|
if chunks == nil {
|
||||||
// Compute the shard map and relevant chunk boundaries, if not supplied.
|
// Compute the shard map and relevant chunk boundaries, if not supplied.
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue