domains: validate domain configs in a cron
no email notification yet, we have to rework this notifications/eventlog stuff
This commit is contained in:
+10
-1
@@ -29,6 +29,7 @@ const appHealthMonitor = require('./apphealthmonitor.js'),
|
||||
constants = require('./constants.js'),
|
||||
{ CronJob } = require('cron'),
|
||||
debug = require('debug')('box:cron'),
|
||||
domains = require('./domains.js'),
|
||||
dyndns = require('./dyndns.js'),
|
||||
externalLdap = require('./externalldap.js'),
|
||||
eventlog = require('./eventlog.js'),
|
||||
@@ -60,7 +61,8 @@ const gJobs = {
|
||||
schedulerSync: null,
|
||||
appHealthMonitor: null,
|
||||
diskUsage: null,
|
||||
externalLdapSyncer: null
|
||||
externalLdapSyncer: null,
|
||||
checkDomainConfigs: null
|
||||
};
|
||||
|
||||
// cron format
|
||||
@@ -167,6 +169,13 @@ async function startJobs() {
|
||||
start: true
|
||||
});
|
||||
|
||||
|
||||
gJobs.checkDomainConfigs = CronJob.from({
|
||||
cronTime: `00 ${minute} 5 * * *`, // once a day
|
||||
onTick: async () => await safe(domains.checkConfigs(AuditSource.CRON), { debug }),
|
||||
start: true
|
||||
});
|
||||
|
||||
gJobs.appHealthMonitor = CronJob.from({
|
||||
cronTime: '*/10 * * * * *', // every 10 seconds
|
||||
onTick: async () => await safe(appHealthMonitor.run(10), { debug }), // 10 is the max run time
|
||||
|
||||
Reference in New Issue
Block a user