dyndns: run as a task

this lets us display logs
This commit is contained in:
Girish Ramakrishnan
2023-07-08 19:48:12 +05:30
parent 56b7cc4041
commit 23f0eba1bd
11 changed files with 108 additions and 31 deletions

View File

@@ -245,8 +245,9 @@ function dynamicDnsChanged(enabled) {
if (enabled) {
gJobs.dynamicDns = new CronJob({
cronTime: '5 * * * * *', // we only update the records if the ip has changed.
onTick: async () => await safe(dyndns.sync(AuditSource.CRON), { debug }),
// often home IPs change at the full hour, so we give it 5min to settle
cronTime: '00 5 * * * *',
onTick: async () => { await safe(dyndns.refreshDns(AuditSource.CRON), { debug }); },
start: true
});
} else {