certs: show daysLeft in the logs

This commit is contained in:
Girish Ramakrishnan
2021-06-24 00:48:54 -07:00
parent 7d3270e51a
commit 6da7218d34
2 changed files with 7 additions and 4 deletions

View File

@@ -251,7 +251,7 @@ async function onEvent(id, action, source, data) {
case eventlog.ACTION_CERTIFICATE_RENEWAL:
case eventlog.ACTION_CERTIFICATE_NEW:
if (!data.errorMessage) return;
if (!data.notAfter || (data.notAfter - new Date() >= (60 * 60 * 24 * 10 * 1000))) return; // more than 10 days left to expire
if (!data.notAfter || (data.notAfter - new Date() >= (10 * 24 * 60 * 60 * 1000))) return; // more than 10 days left to expire
return await certificateRenewalError(id, data.domain, data.errorMessage);
case eventlog.ACTION_BACKUP_FINISH: