0
Fork 0
mirror of https://github.com/caddyserver/caddy.git synced 2025-01-13 22:51:08 -05:00

Whoops, finishing up the last commit properly

Need to add the name to namesObtaining each time we use the ACME client.
This commit is contained in:
Matthew Holt 2016-08-10 23:44:43 -06:00
parent 8e75ae2495
commit 46bc0d5c4e
No known key found for this signature in database
GPG key ID: 0D97CC73664F4D03
2 changed files with 4 additions and 0 deletions

View file

@ -236,9 +236,11 @@ func (c *ACMEClient) Renew(name string) error {
var newCertMeta acme.CertificateResource
var success bool
for attempts := 0; attempts < 2; attempts++ {
namesObtaining.Add([]string{name})
acmeMu.Lock()
newCertMeta, err = c.RenewCertificate(certMeta, true)
acmeMu.Unlock()
namesObtaining.Remove([]string{name})
if err == nil {
success = true
break

View file

@ -214,9 +214,11 @@ func (c *Config) renewCertName(name string, allowPrompts bool) error {
var newCertMeta acme.CertificateResource
var success bool
for attempts := 0; attempts < 2; attempts++ {
namesObtaining.Add([]string{name})
acmeMu.Lock()
newCertMeta, err = client.RenewCertificate(certMeta, true)
acmeMu.Unlock()
namesObtaining.Remove([]string{name})
if err == nil {
success = true
break