adonisjs-scheduler
Advanced tools
Comparing version 0.0.17 to 0.0.18
@@ -23,2 +23,4 @@ "use strict"; | ||
} | ||
}, { | ||
runOnInit: command.runOnInit | ||
}); | ||
@@ -25,0 +27,0 @@ } |
@@ -5,2 +5,4 @@ import { BaseCommand } from '@adonisjs/core/build/standalone'; | ||
expression: string; | ||
runOnInit: boolean; | ||
immediate(state?: boolean): void; | ||
everyMinutes(minutes: number): this; | ||
@@ -7,0 +9,0 @@ everyMinute(): this; |
@@ -13,3 +13,12 @@ "use strict"; | ||
}); | ||
Object.defineProperty(this, "runOnInit", { | ||
enumerable: true, | ||
configurable: true, | ||
writable: true, | ||
value: false | ||
}); | ||
} | ||
immediate(state = true) { | ||
this.runOnInit = state; | ||
} | ||
everyMinutes(minutes) { | ||
@@ -16,0 +25,0 @@ this.expression = (0, node_cron_expression_1.every)(minutes).minutes().toString(); |
{ | ||
"name": "adonisjs-scheduler", | ||
"version": "0.0.17", | ||
"version": "0.0.18", | ||
"description": "Task scheduler for AdonisJS", | ||
@@ -34,3 +34,3 @@ "homepage": "https://github.com/KABBOUCHI/adonisjs-scheduler#readme", | ||
"@adonisjs/sink": "^5.3.0", | ||
"@types/node-cron": "^3.0.5", | ||
"@types/node-cron": "^3.0.7", | ||
"copyfiles": "^2.4.1", | ||
@@ -37,0 +37,0 @@ "eslint": "^8.19.0", |
@@ -83,2 +83,3 @@ <div align="center"> | ||
`.yearly();` | Run the task on the first day of every year at 00:00 | ||
`.immediate();` | Run the task on startup | ||
21159
447
85