Skip to content

Commit

Permalink
lib: fix backoff in SolverManager (#1428)
Browse files Browse the repository at this point in the history
  • Loading branch information
quenbyako authored Jun 11, 2021
1 parent 8746bc7 commit 9b44e4a
Showing 1 changed file with 3 additions and 8 deletions.
11 changes: 3 additions & 8 deletions challenge/resolver/solver_manager.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package resolver

import (
"context"
"errors"
"fmt"
"sort"
Expand Down Expand Up @@ -107,21 +106,17 @@ func validate(core *api.Core, domain string, chlg acme.Challenge) error {
bo.MaxInterval = 10 * initialInterval
bo.MaxElapsedTime = 100 * initialInterval

ctx, cancel := context.WithCancel(context.Background())

// After the path is sent, the ACME server will access our server.
// Repeatedly check the server for an updated status on our request.
operation := func() error {
authz, err := core.Authorizations.Get(chlng.AuthorizationURL)
if err != nil {
cancel()
return err
return backoff.Permanent(err)
}

valid, err := checkAuthorizationStatus(authz)
if err != nil {
cancel()
return err
return backoff.Permanent(err)
}

if valid {
Expand All @@ -132,7 +127,7 @@ func validate(core *api.Core, domain string, chlg acme.Challenge) error {
return errors.New("the server didn't respond to our request")
}

return backoff.Retry(operation, backoff.WithContext(bo, ctx))
return backoff.Retry(operation, bo)
}

func checkChallengeStatus(chlng acme.ExtendedChallenge) (bool, error) {
Expand Down

0 comments on commit 9b44e4a

Please sign in to comment.