Table of contents
adonis5-scheduler
AdonisJS5、cron、cronjob、调度
程序/reg2005/adonis5-scheduler/master.svg?style=for-the-badge&logo=travis" alt="travis-image">
这个库提供了一种为 AdonisJS v5 安排重复任务的简单方法。
Installation
安装它:
npm i --save adonis5-scheduler
编译您的代码:
node ace serve --watch
连接所有依赖项:
node ace invoke adonis5-scheduler
Usage
Creating your first task
node ace make:task MyTaskName
Starting the scheduler
使用包含的 ace 命令很容易启动 kue 侦听器的实例。
提供程序在您的 AdonisJS 项目的 app/Tasks 目录中查找作业,并会自动为它找到的任何任务注册一个处理程序。
node ace scheduler:run
Name |
Required |
Type |
Static |
Description |
schedule |
true |
many |
true |
The schedule for which the task should run. More docs. |
handle |
true |
function |
false |
A function that is called for this task. |
Thanks
特别感谢 AdonisJS 的创建者创建了如此出色的框架和 nrempel 创建者 Adonis v4 的调度程序包
Table of contents
adonis5-scheduler
AdonisJS5, cron, cronjob, scheduler
This library provides an easy way to schedule recurring tasks for AdonisJS v5.
Installation
Install it:
npm i --save adonis5-scheduler
Compile your code:
node ace serve --watch
Connect all dependences:
node ace invoke adonis5-scheduler
Usage
Creating your first task
node ace make:task MyTaskName
Starting the scheduler
Starting an instance of the kue listener is easy with the included ace command.
The provider looks for jobs in the app/Tasks directory of your AdonisJS project and will automatically register a handler for any tasks that it finds.
node ace scheduler:run
Name |
Required |
Type |
Static |
Description |
schedule |
true |
many |
true |
The schedule for which the task should run. More docs. |
handle |
true |
function |
false |
A function that is called for this task. |
Thanks
Special thanks to the creator(s) of AdonisJS for creating such a great framework and nrempel creator scheduler package for Adonis v4