psdev-task-manager 1.1.4 → 1.1.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
1
  const { withDuration, withSuccessRateLogs } = require('psdev-utils');
2
2
 
3
- const { TASK_STATUS, CRON_JOB_MAX_DURATION_SEC } = require('./consts');
3
+ const { TASK_STATUS, CRON_JOB_MAX_DURATION_SEC, TASK_MAX_TRIES } = require('./consts');
4
4
  const { scheduleChildTasksAndUpdateParent } = require('./parentChildTasks/handler');
5
5
  const {
6
6
  saveTaskResultToAdditionalCollection,
@@ -171,7 +171,7 @@ const filterScheduledTasksByStatus = (tasks, tasksConfig) => {
171
171
  console.log(
172
172
  `filterScheduledTasksByStatus: tasks count: ${tasks.length} tasksConfig: ${JSON.stringify(tasksConfig)}`
173
173
  );
174
- const shouldIncludeTask = (task, tasksConfig) => {
174
+ const shouldIncludeTask = (task, taskConfig) => {
175
175
  console.log(`filterScheduledTasksByStatus: task: ${JSON.stringify(task)}`);
176
176
  console.log(
177
177
  `filterScheduledTasksByStatus: taskConfig: ${JSON.stringify(taskConfig)}`
@@ -179,7 +179,7 @@ const filterScheduledTasksByStatus = (tasks, tasksConfig) => {
179
179
  const { status } = task;
180
180
  if (status === TASK_STATUS.IN_PROGRESS) {
181
181
  //Only include parent tasks that are in progress, to continue running next children
182
- return isParentTask(task, tasksConfig[task.name]);
182
+ return isParentTask(task, taskConfig);
183
183
  }
184
184
  if (status === TASK_STATUS.FAILED) {
185
185
  // Exclude if it's a parent task, if parent task failed, we don't retry it anymore
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "psdev-task-manager",
3
- "version": "1.1.4",
3
+ "version": "1.1.5",
4
4
  "description": "Task manager library",
5
5
  "keywords": [
6
6
  "task-manager"