Commit 46bc0d5c authored by Matthew Holt's avatar Matthew Holt

Whoops, finishing up the last commit properly

Need to add the name to namesObtaining each time we use the ACME client.
parent 8e75ae24
......@@ -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
......
......@@ -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
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment