const moment = require('moment') // let TEST = false TEST = true module.exports = async function (app, task) { let job = null try { job = app.fs.scheduleInit( { interval: task.cron, immediate: TEST, proRun: !TEST, }, async () => { try { console.log(task.taskName, moment().format('YYYY-MM-DD HH:mm:ss')); } catch (error) { app.fs.logger.error(`sechedule: taskJobs, error: ${error}`) } }); } catch (error) { app.fs.logger.error(`sechedule: taskJobs, error: ${error}`); } return job; }