lib-task-scheduler
Advanced tools
Comparing version 4.0.111 to 4.0.112
@@ -102,10 +102,11 @@ "use strict"; | ||
const nextExecutionEpochMs = this.calculateNextExecutionEpochMs(config); | ||
const relativeMs = nextExecutionEpochMs - _.now(); // for logging, includes jitter randomness | ||
let taskSchedule = _.find(this.schedules, e => e.config.name === config.name); | ||
if (!taskSchedule) { | ||
taskSchedule = { task, config, nextExecutionEpochMs }; | ||
this.log.info(`Scheduling new task ${config.name} to now + ${config.intervalMs}ms.`); | ||
this.log.info(`Scheduling new task ${config.name} to now + ${relativeMs}ms.`); | ||
this.schedules.push(taskSchedule); | ||
} | ||
else { | ||
this.log.info(`Rescheduling task ${config.name} to now + ${config.intervalMs}ms.`); | ||
this.log.info(`Rescheduling task ${config.name} to now + ${relativeMs}ms.`); | ||
taskSchedule.nextExecutionEpochMs = nextExecutionEpochMs; | ||
@@ -183,3 +184,3 @@ } | ||
this.log.error(`Promise for ${schedule.config.name} is still pending (skipping this execution;` + | ||
` delaying ${schedule.config.intervalMs}ms).`); | ||
` delaying ${schedule.config.intervalMs}ms + jitter).`); | ||
return; | ||
@@ -186,0 +187,0 @@ } |
{ | ||
"name": "lib-task-scheduler", | ||
"version": "4.0.111", | ||
"version": "4.0.112", | ||
"description": "A lightweight, modular task scheduler.", | ||
@@ -5,0 +5,0 @@ "homepage": "https://github.com/convoyinc/lib-task-scheduler", |
Sorry, the diff of this file is not supported yet
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
158157
2327