think-crontab
v1.0.4
Published
crontab for thinkjs
Downloads
2,694
Readme
think-crontab
How to use
src/config/crontab.js
,
module.exports = [{
interval: '10s',
immediate: true,
handle: () => {
//do something
}
}, {
cron: '0 */1 * * *',
handle: 'crontab/test',
worker: 'all'
}]
options
interval
{String|Number} interval taskcron
{String} cron taskworker
{String} task type, one/all, default is onehandle
{Function|String} task handle, requiredimmediate
{Boolean} immediate to run task, default is falseenable
{Boolean} enable task, default is true