add certificate-notification job

This commit is contained in:
Louis Lam 2021-10-23 21:44:21 +08:00
parent d578300104
commit 957c292307
2 changed files with 18 additions and 1 deletions

View file

@ -6,7 +6,11 @@ const jobs = [
{
name: "clear-old-data",
interval: "at 03:14",
}
},
{
name: "certificate-notification",
interval: "60 seconds", // TODO: Production should be larger
},
];
const initBackgroundJobs = function (args) {

View file

@ -0,0 +1,13 @@
const { log, exit, connectDb } = require("./util-worker");
const { R } = require("redbean-node");
const { setSetting, setting } = require("../util-server");
(async () => {
await connectDb();
console.log("Checking Certificate Expiry Date");
// TODO: Query monitor_tls_info
exit();
})();