https://github.com/thinkjs/think-crontab
Crontab for ThinkJS 3.x
https://github.com/thinkjs/think-crontab
crontab thinkjs3
Last synced: 12 months ago
JSON representation
Crontab for ThinkJS 3.x
- Host: GitHub
- URL: https://github.com/thinkjs/think-crontab
- Owner: thinkjs
- License: mit
- Created: 2017-03-09T06:34:39.000Z (about 9 years ago)
- Default Branch: master
- Last Pushed: 2017-09-16T14:19:53.000Z (over 8 years ago)
- Last Synced: 2025-03-22T03:51:17.303Z (about 1 year ago)
- Topics: crontab, thinkjs3
- Language: JavaScript
- Homepage:
- Size: 15.6 KB
- Stars: 2
- Watchers: 9
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# think-crontab
[](https://travis-ci.org/thinkjs/think-crontab)
[](https://coveralls.io/github/thinkjs/think-crontab?branch=master)
[](https://www.npmjs.com/package/think-crontab)
## How to use
`src/config/crontab.js`,
```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