From 46bc0d5c4e96c51be6eb21e93a700a6e46bd9c57 Mon Sep 17 00:00:00 2001 From: Matthew Holt Date: Wed, 10 Aug 2016 23:44:43 -0600 Subject: [PATCH] Whoops, finishing up the last commit properly Need to add the name to namesObtaining each time we use the ACME client. --- caddytls/client.go | 2 ++ caddytls/config.go | 2 ++ 2 files changed, 4 insertions(+) diff --git a/caddytls/client.go b/caddytls/client.go index c754ab1c0..a051880f5 100644 --- a/caddytls/client.go +++ b/caddytls/client.go @@ -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 diff --git a/caddytls/config.go b/caddytls/config.go index 89ccafd75..f1dcff84d 100644 --- a/caddytls/config.go +++ b/caddytls/config.go @@ -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