ensuring a resolved job doesn't get resolved twice

This commit is contained in:
Hossein Shafagh 2021-01-29 15:46:22 -08:00
parent 5fb98f747c
commit 31b20e0a30
1 changed files with 2 additions and 1 deletions

View File

@ -274,7 +274,8 @@ def fetch_acme_cert(id):
real_cert = cert.get("cert")
# It's necessary to reload the pending cert due to detached instance: http://sqlalche.me/e/bhk3
pending_cert = pending_certificate_service.get(cert.get("pending_cert").id)
if not pending_cert:
if not pending_cert or pending_cert.resolved:
# pending_cert is cleared or it was resolved by another process
log_data[
"message"
] = "Pending certificate doesn't exist anymore. Was it resolved by another process?"