adonis-scheduler
Advanced tools
Comparing version 1.0.0 to 2.0.0
@@ -13,3 +13,3 @@ 'use strict'; | ||
// This is the function that is called at the defined schedule | ||
static handle() { | ||
* handle() { | ||
// Do stuff here | ||
@@ -16,0 +16,0 @@ } |
{ | ||
"name": "adonis-scheduler", | ||
"version": "1.0.0", | ||
"version": "2.0.0", | ||
"description": "Easy task scheduling for AdonisJS", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -7,2 +7,3 @@ 'use strict'; | ||
const logger = new CatLog('adonis:scheduler'); | ||
const Ioc = require('adonis-fold').Ioc; | ||
@@ -40,4 +41,7 @@ /** | ||
// Get instance of task class | ||
const taskInstance = Ioc.make(Task); | ||
// Every task must expose a handle function | ||
if (!Task.handle) { | ||
if (!taskInstance.handle) { | ||
throw new Error(`No handler found for task: ${filePath}`); | ||
@@ -50,3 +54,3 @@ } | ||
// Register task handler | ||
this.instance.scheduleJob(Task.schedule, Task.handle); | ||
this.instance.scheduleJob(Task.schedule, taskInstance.handle); | ||
} catch (e) { | ||
@@ -53,0 +57,0 @@ // If this file is not a valid javascript class, print warning and return |
@@ -5,3 +5,3 @@ 'use strict'; | ||
static handle() { | ||
* handle() { | ||
@@ -8,0 +8,0 @@ } |
@@ -9,4 +9,4 @@ 'use strict'; | ||
static handle() { | ||
* handle() { | ||
} | ||
@@ -13,0 +13,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
11360
224