magnet-node-schedule
v2.0.0
Published
Readme
Downloads
29
Maintainers
Readme
Usage
All router api should refer node-schedule This module techinicall no need to convert to magnet
Basic
import magnet from 'magnet-core'
import Config from 'magnet-config'
import Logger from 'magnet-bunyan'
import Schedule from 'magnet-node-schedule'
let app = await magnet([Config, Logger, Schedule])
server/jobs/test.js
import _promise from 'bluebird'
export default function ({ nodeSchedule }) {
nodeSchedule.scheduleJob(
'*/1 * * * * *',
async function process () {
console.log('testing scheduler 2222', await _promise.resolve('hey').timeout(1000))
}
)
}