psdev-task-manager 2.0.7 → 2.0.8

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.
@@ -75,8 +75,9 @@ function taskManager() {
75
75
  }
76
76
  const isFailedAfterAllRetries = amountOfRetries >= TASK_MAX_TRIES;
77
77
  if (isFailedAfterAllRetries) {
78
+
78
79
  //Only throw error if task is permanently failed, otherwise we have retry mechanism
79
- throw new Error(errMsg);
80
+ throw new Error("task failed after all retries: " + errMsg);
80
81
  }
81
82
  }
82
83
  },
@@ -122,7 +123,6 @@ function taskManager() {
122
123
  try {
123
124
  const scheduledTasks = await getScheduledTasks();
124
125
  console.log(`runScheduledTasks: scheduledTasks count: ${scheduledTasks.length}`);
125
- console.log(`runScheduledTasks: tasksConfig: ${JSON.stringify(tasksConfig)}`);
126
126
  if (scheduledTasks.length) {
127
127
  await processTasksBasedOnVeloLimit(scheduledTasks, tasksConfig);
128
128
  } else {
@@ -168,9 +168,7 @@ const isParentTask = (task, taskConfig) => {
168
168
  return true;
169
169
  };
170
170
  const filterScheduledTasksByStatus = (tasks, tasksConfig) => {
171
- console.log(
172
- `filterScheduledTasksByStatus: tasks count: ${tasks.length} tasksConfig: ${JSON.stringify(tasksConfig)}`
173
- );
171
+
174
172
  const shouldIncludeTask = (task, taskConfig) => {
175
173
  console.log(`filterScheduledTasksByStatus: task: ${JSON.stringify(task)}`);
176
174
  console.log(`filterScheduledTasksByStatus: taskConfig: ${JSON.stringify(taskConfig)}`);
@@ -240,13 +238,11 @@ const getTasksToProcess = ({ scheduledTasks, tasksConfig, maxDuration }) => {
240
238
  });
241
239
  const tasksToProcess = [];
242
240
  let totalDuration = 0;
243
- console.log(`tasksConfig is : ${JSON.stringify(tasksConfig)}`);
244
241
  const filteredScheduledTasks = filterScheduledTasksByStatus(scheduledTasks, tasksConfig);
245
242
  console.log(`filteredScheduledTasks count : ${filteredScheduledTasks.length}`);
246
243
  for (const task of filteredScheduledTasks) {
247
244
  console.log(`task is : ${JSON.stringify(task)}`);
248
245
  const taskConfig = getTaskConfig(task.name, tasksConfig);
249
- console.log(`taskConfig is : ${JSON.stringify(taskConfig)}`);
250
246
  const estimated = taskConfig?.estimatedDurationSec;
251
247
  if (!estimated) {
252
248
  const errMsg = `[getTasksToProcess] estimatedDurationSec is not defined for task ${task.name}`;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "psdev-task-manager",
3
- "version": "2.0.7",
3
+ "version": "2.0.8",
4
4
  "description": "Task manager library",
5
5
  "keywords": [
6
6
  "task-manager"