Randomize certificate renewal check over a whole day

This commit is contained in:
Johannes Zellner
2022-07-22 19:32:43 +02:00
parent 116cde19f9
commit 5b31486dc9

View File

@@ -114,8 +114,9 @@ async function startJobs() {
start: true
});
// randomized over minute an hours, once a day to not hammer Let'sEncrypt on the same schedule
gJobs.certificateRenew = new CronJob({
cronTime: '00 00 */12 * * *', // every 12 hours
cronTime: `00 ${parseInt(Math.random()*60)} ${parseInt(Math.random()*24)} * * *`,
onTick: async () => await safe(cloudron.renewCerts({}, AuditSource.CRON), { debug }),
start: true
});