Skip to content

Commit 70985a8

Browse files
committed
Do not log renewal checks for invalid certificates.
1 parent afc4962 commit 70985a8

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

src/lib.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -285,10 +285,14 @@ async fn ngx_http_acme_update_certificates_for_issuer(
285285
{
286286
let locked = cert.read();
287287

288+
if !locked.is_valid() {
289+
continue;
290+
}
291+
288292
if !locked.is_renewable() {
289293
ngx_log_debug!(
290294
log.as_ptr(),
291-
"acme: certificate \"{}/{}\" is not renewable",
295+
"acme: certificate \"{}/{}\" is not due for renewal",
292296
issuer.name,
293297
order.cache_key()
294298
);

src/state/certificate.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -243,7 +243,11 @@ where
243243
}
244244

245245
pub fn is_renewable(&self) -> bool {
246-
!matches!(self.state, CertificateState::Invalid { .. }) && Time::now() >= self.next
246+
self.is_valid() && Time::now() >= self.next
247+
}
248+
249+
pub fn is_valid(&self) -> bool {
250+
!matches!(self.state, CertificateState::Invalid { .. })
247251
}
248252
}
249253

0 commit comments

Comments
 (0)