simplify values assignment

This commit is contained in:
Karol Wypchlo 2020-09-10 14:13:28 +02:00
parent 394ae44aa9
commit 2e240e2819
1 changed files with 8 additions and 6 deletions

View File

@ -5,18 +5,20 @@ const { verboseChecks } = require("./checks/verbose");
// execute the critical health-check script every 5 minutes
const criticalJob = schedule.scheduleJob("*/5 * * * *", async () => {
const entry = { date: new Date().toISOString(), checks: [] };
entry.checks = await Promise.all(criticalChecks.map((check) => new Promise(check)));
const entry = {
date: new Date().toISOString(),
checks: await Promise.all(criticalChecks.map((check) => new Promise(check))),
};
db.get("critical").push(entry).write();
});
// execute the verbose health-check script once per hour
const verboseJob = schedule.scheduleJob("0 * * * *", async () => {
const entry = { date: new Date().toISOString(), checks: [] };
entry.checks = await Promise.all(verboseChecks.map((check) => new Promise(check)));
const entry = {
date: new Date().toISOString(),
checks: await Promise.all(verboseChecks.map((check) => new Promise(check))),
};
db.get("verbose").push(entry).write();
});