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