Skip to content

Commit

Permalink
Address comment.
Browse files Browse the repository at this point in the history
  • Loading branch information
beautifulentropy committed Sep 30, 2024
1 parent 8439d02 commit faf4324
Showing 1 changed file with 2 additions and 9 deletions.
11 changes: 2 additions & 9 deletions va/va.go
Original file line number Diff line number Diff line change
Expand Up @@ -466,24 +466,17 @@ func (va *ValidationAuthorityImpl) performRemoteValidation(
response *vapb.ValidationResult
err error
}
results := make(chan *rvaResult, len(va.remoteVAs))

ctx, cancel := context.WithCancel(ctx)
defer cancel()
results := make(chan *rvaResult, len(va.remoteVAs))

for _, i := range rand.Perm(len(va.remoteVAs)) {
remoteVA := va.remoteVAs[i]
go func(rva RemoteVA, out chan<- *rvaResult) {
res, err := rva.PerformValidation(ctx, req)
select {
case out <- &rvaResult{
out <- &rvaResult{
hostname: rva.Address,
response: res,
err: err,
}:
case <-ctx.Done():
// Context canceled, exit the goroutine.
return
}
}(remoteVA, results)
}
Expand Down

0 comments on commit faf4324

Please sign in to comment.