adonisjs-scheduler
Advanced tools
Comparing version 0.0.24 to 0.0.25
@@ -14,3 +14,5 @@ "use strict"; | ||
if (lock.isBusy(options.key)) { | ||
console.log(`${options.key} is busy`); | ||
if (options.onBusy) { | ||
await options.onBusy(); | ||
} | ||
return; | ||
@@ -25,2 +27,3 @@ } | ||
const Ace = this.application.container.use('Adonis/Core/Ace'); | ||
const Logger = this.application.container.use('Adonis/Core/Logger'); | ||
for (let index = 0; index < Scheduler.items.length; index++) { | ||
@@ -34,3 +37,6 @@ const command = Scheduler.items[index]; | ||
timeout: command.config.expiresAt, | ||
key: `${index}-${command.commandName}-${command.commandArgs}` | ||
key: `${index}-${command.commandName}-${command.commandArgs}`, | ||
onBusy: () => { | ||
Logger.warn(`Command ${index}-${command.commandName}-${command.commandArgs} is busy`); | ||
} | ||
}); | ||
@@ -42,3 +48,6 @@ break; | ||
timeout: command.config.expiresAt, | ||
key: `${index}-callback` | ||
key: `${index}-callback`, | ||
onBusy: () => { | ||
Logger.warn(`Callback ${index} is busy`); | ||
} | ||
}); | ||
@@ -53,3 +62,3 @@ default: | ||
} | ||
this.logger.info(`Schedule worker started successfully.`); | ||
Logger.info(`Schedule worker started successfully.`); | ||
} | ||
@@ -56,0 +65,0 @@ } |
{ | ||
"name": "adonisjs-scheduler", | ||
"version": "0.0.24", | ||
"version": "0.0.25", | ||
"description": "Task scheduler for AdonisJS", | ||
@@ -5,0 +5,0 @@ "homepage": "https://github.com/KABBOUCHI/adonisjs-scheduler#readme", |
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
24106
512