IOT线 鉴权系统
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

18 lines
570 B

'use strict';
const fs = require('fs');
// 将定时任务汇集未来可根据需要选取操作
module.exports = async function (app, opts) {
fs.readdirSync(__dirname).forEach((filename) => {
if (!['index.js'].some(f => filename == f)) {
const schedule = require(`./${filename}`)(app, opts)
for (let k of Object.keys(schedule)) {
console.info(`定时任务 ${k} 启动`);
}
app.fs.utils = {
...app.fs.schedule,
...schedule,
}
}
});
};