ACME DNS challenges
This commit is contained in:
parent
7a2592b2fa
commit
5bdf8a5ea3
127 changed files with 24386 additions and 739 deletions
10
vendor/github.com/xenolf/lego/acme/utils.go
generated
vendored
10
vendor/github.com/xenolf/lego/acme/utils.go
generated
vendored
|
@ -3,16 +3,20 @@ package acme
|
|||
import (
|
||||
"fmt"
|
||||
"time"
|
||||
|
||||
"github.com/xenolf/lego/log"
|
||||
)
|
||||
|
||||
// WaitFor polls the given function 'f', once every 'interval', up to 'timeout'.
|
||||
func WaitFor(timeout, interval time.Duration, f func() (bool, error)) error {
|
||||
log.Infof("Wait [timeout: %s, interval: %s]", timeout, interval)
|
||||
|
||||
var lastErr string
|
||||
timeup := time.After(timeout)
|
||||
timeUp := time.After(timeout)
|
||||
for {
|
||||
select {
|
||||
case <-timeup:
|
||||
return fmt.Errorf("Time limit exceeded. Last error: %s", lastErr)
|
||||
case <-timeUp:
|
||||
return fmt.Errorf("time limit exceeded: last error: %s", lastErr)
|
||||
default:
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue