think-crontab
How to use
src/config/crontab.js
,
moduleexports = interval: '10s' immediate: true { //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