@vorplex/core 0.0.40 → 0.0.42

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.
@@ -30,6 +30,7 @@ export class Task extends Subscribable {
30
30
  }
31
31
  cancel() {
32
32
  if (this.status === TaskStatus.Busy) {
33
+ this.log('Task cancelled', { level: 'error' });
33
34
  this.status = TaskStatus.Cancelled;
34
35
  this.finishTimestamp = Date.now();
35
36
  this.emit(this);
@@ -92,19 +93,18 @@ export class Task extends Subscribable {
92
93
  }
93
94
  }
94
95
  getStatus() {
95
- let failed;
96
- if (this.isCancelled())
97
- return TaskStatus.Cancelled;
96
+ if (this.status !== TaskStatus.Busy)
97
+ return this.status;
98
98
  for (const task of this.tasks) {
99
99
  const status = task.getStatus();
100
100
  if (status === TaskStatus.Failed)
101
- failed = true;
101
+ return TaskStatus.Failed;
102
102
  if (status === TaskStatus.Busy)
103
103
  return TaskStatus.Busy;
104
104
  }
105
- if (failed)
106
- return TaskStatus.Failed;
107
- return this.status;
105
+ if (this.isCancelled())
106
+ return TaskStatus.Cancelled;
107
+ return TaskStatus.Busy;
108
108
  }
109
109
  hasWarning() {
110
110
  for (const log of this.logs) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vorplex/core",
3
- "version": "0.0.40",
3
+ "version": "0.0.42",
4
4
  "type": "module",
5
5
  "sideEffects": false,
6
6
  "files": [