fix: auto certificate may be blocked by errors #182

This commit is contained in:
0xJacky 2023-11-28 11:21:49 +08:00
parent 50b4fbcda4
commit b475d8b609
No known key found for this signature in database
GPG key ID: B6E4A6E4A561BAF0
8 changed files with 99 additions and 95 deletions

View file

@ -50,7 +50,7 @@ func (t *AutoCertErrorLog) Exit(text string, err error) {
func (t *AutoCertErrorLog) ToString() (content string) {
for _, v := range t.buffer {
content += fmt.Sprintf("[AutoCert Error] %s\n", v)
content += fmt.Sprintf("[Error] %s\n", v)
}
return
@ -103,6 +103,8 @@ func AutoObtain() {
ChallengeMethod: certModel.ChallengeMethod,
DNSCredentialID: certModel.DnsCredentialID,
}
// logChan and errChan should be closed inside IssueCert
go IssueCert(payload, logChan, errChan)
go handleIssueCertLogChan(logChan)
@ -121,8 +123,6 @@ func AutoObtain() {
} else {
certModel.ClearLog()
}
close(logChan)
}
logger.Info("AutoCert Worker End")
}