Skip to content

Commit

Permalink
refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
ldez committed Jun 15, 2022
1 parent c03c865 commit f1fe9cd
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions cmd/cmd_renew.go
Original file line number Diff line number Diff line change
Expand Up @@ -141,12 +141,11 @@ func renewForDomains(ctx *cli.Context, client *lego.Client, certsStorage *Certif
// https://github.com/go-acme/lego/issues/1656
// https://github.com/certbot/certbot/blob/284023a1b7672be2bd4018dd7623b3b92197d4b0/certbot/certbot/_internal/renewal.py#L472
const jitter = 8 * time.Minute
rndSource := rand.NewSource(time.Now().UnixNano())
rnd := rand.New(rndSource)
rnd := rand.New(rand.NewSource(time.Now().UnixNano()))
sleepTime := time.Duration(rnd.Int63n(int64(jitter)))

log.Infof("renewal: random delay of %s", sleepTime)
time.Sleep(time.Duration(sleepTime))
time.Sleep(sleepTime)
}

request := certificate.ObtainRequest{
Expand Down

0 comments on commit f1fe9cd

Please sign in to comment.