Unfinished, do not pull.

This commit is contained in:
Kwafuri
2024-03-21 07:12:04 +00:00
parent 98c7f46085
commit 44a55219d9
16 changed files with 1315 additions and 194 deletions
+15
View File
@@ -0,0 +1,15 @@
const cron = require('node-cron');
async function cronjob() {
cron.schedule('* * * * * *', async () => {
//run every .js file in the crons folder
const fs = require('fs');
const path = require('path');
const normalizedPath = path.join(__dirname, './crons');
fs.readdirSync(normalizedPath).forEach((file) => {
require(`./crons/${file}`);
});
});
}
module.exports = cronjob;