const { Scheduler } = require('mongo-cronjob'); const service = require('feathers-mongoose'); const handleAttendClassJob = require('../../handlers'); const Model = require('./models.js').Event; const handleTestJob = () => new Promise(res => setTimeout(res, 10000)); module.exports = app => { app.use('/events', service({ Model })); const scheduler = new Scheduler(Model); scheduler.registerHandler('class', handleAttendClassJob); scheduler.registerHandler('test', handleTestJob); };