adonis-scheduler
Advanced tools
Comparing version 2.0.1 to 2.0.2
{ | ||
"name": "adonis-scheduler", | ||
"version": "2.0.1", | ||
"version": "2.0.2", | ||
"description": "Easy task scheduling for AdonisJS", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -53,8 +53,8 @@ # Adonis Kue Provider | ||
Jobs are easy to create. They live in `app/Tasks` and they are a simple class. They expose the following `static` properties: | ||
Jobs are easy to create. They live in `app/Tasks` and they are a simple class. They expose the following properties: | ||
| Name | Required | type | Description | | ||
|-------------|----------|-----------|----------------------------------------------------------------| | ||
| schedule | true | many | The schedule for which the task should run. [More docs.](https://github.com/node-schedule/node-schedule#cron-style-scheduling) | | ||
| handle | true | function | A function that is called for this task. | | ||
| Name | Required | Type | Static | Description | | ||
|-------------|----------|-----------|--------|--------------------------------------------------------| | ||
| schedule | true | many | true | The schedule for which the task should run. [More docs.](https://github.com/node-schedule/node-schedule#cron-style-scheduling) | | ||
| handle | true | function | false | A function that is called for this task. | | ||
@@ -61,0 +61,0 @@ [Here's an example.](examples/app/Tasks/Example.js) |
@@ -38,3 +38,3 @@ 'use strict'; | ||
// Every task must expose a schedule | ||
if (!taskInstance.schedule) { | ||
if (!Task.schedule) { | ||
throw new Error(`No schedule found for task: ${filePath}`); | ||
@@ -49,6 +49,6 @@ } | ||
// Track currently registered tasks in memory | ||
this.registeredTasks.push(taskInstance); | ||
this.registeredTasks.push(Task); | ||
// Register task handler | ||
this.instance.scheduleJob(taskInstance.schedule, taskInstance.handle); | ||
this.instance.scheduleJob(Task.schedule, taskInstance.handle); | ||
} catch (e) { | ||
@@ -55,0 +55,0 @@ // If this file is not a valid javascript class, print warning and return |
@@ -5,3 +5,3 @@ 'use strict'; | ||
get schedule() { | ||
static get schedule() { | ||
return '*/1 * * * * *'; | ||
@@ -8,0 +8,0 @@ } |
@@ -5,3 +5,3 @@ 'use strict'; | ||
get schedule() { | ||
static get schedule() { | ||
return '*/1 * * * * *'; | ||
@@ -8,0 +8,0 @@ } |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
11368