Crontab for ThinkJS 3.x
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
test update test case May 15, 2017
.eslintrc
.gitignore
.travis.yml
LICENSE
README.md
index.js
package.json

README.md

think-crontab

Build Status Coverage Status npm

How to use

src/config/crontab.js,

module.exports = [{
  interval: '10s',
  immediate: true,
  handle: () => {
    //do something
  }
}, {
  cron: '0 */1 * * *',
  handle: 'crontab/test',
  type: 'all'
}]

options

  • interval {String|Number} interval task
  • cron {String} cron task
  • type {String} task type, one/all, default is one
  • handle {Function|String} task handle, required
  • immediate {Boolean} immediate to run task, default is false
  • enable {Boolean} enable task, default is true