@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
|
-
|
|
96
|
-
|
|
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
|
-
|
|
101
|
+
return TaskStatus.Failed;
|
|
102
102
|
if (status === TaskStatus.Busy)
|
|
103
103
|
return TaskStatus.Busy;
|
|
104
104
|
}
|
|
105
|
-
if (
|
|
106
|
-
return TaskStatus.
|
|
107
|
-
return
|
|
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) {
|