const moment = require('moment') const initJob = require('../controllers/metadataAcquisition/initJob') module.exports = async function (app, opts) { const jobs = {} try { const { models } = app.fs.dc const tasks = await models.AcquisitionTask.findAll({ where: { enabled: true } }) for (let task of tasks) { const job = await initJob(app, task) jobs[task.id] = job; } } catch (error) { app.fs.logger.error(`sechedule: acqTask, error: ${error}`); } return { taskJobs: jobs } }