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.
23 lines
609 B
23 lines
609 B
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 }
|
|
}
|