simplify values assignment
This commit is contained in:
parent
394ae44aa9
commit
2e240e2819
|
@ -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();
|
||||
});
|
||||
|
|
Reference in New Issue