mirror of
https://gitee.com/nocobase/nocobase.git
synced 2025-05-05 13:39:24 +08:00
fix: test
This commit is contained in:
parent
478d836404
commit
91f8da7aa1
@ -150,6 +150,7 @@ export abstract class TaskType extends EventEmitter implements ITask {
|
|||||||
if (error instanceof CancelError) {
|
if (error instanceof CancelError) {
|
||||||
this.statusChange({ type: 'cancelled' });
|
this.statusChange({ type: 'cancelled' });
|
||||||
this.logger?.info(`Task ${this.taskId} was cancelled during execution`);
|
this.logger?.info(`Task ${this.taskId} was cancelled during execution`);
|
||||||
|
return;
|
||||||
} else {
|
} else {
|
||||||
this.status = {
|
this.status = {
|
||||||
type: 'failed',
|
type: 'failed',
|
||||||
@ -158,9 +159,8 @@ export abstract class TaskType extends EventEmitter implements ITask {
|
|||||||
};
|
};
|
||||||
|
|
||||||
this.logger?.error(`Task ${this.taskId} failed with error: ${error.message}`);
|
this.logger?.error(`Task ${this.taskId} failed with error: ${error.message}`);
|
||||||
}
|
|
||||||
|
|
||||||
this.emit('statusChange', this.status);
|
this.emit('statusChange', this.status);
|
||||||
|
}
|
||||||
} finally {
|
} finally {
|
||||||
this.fulfilledAt = new Date();
|
this.fulfilledAt = new Date();
|
||||||
const duration = this.fulfilledAt.getTime() - this.startedAt.getTime();
|
const duration = this.fulfilledAt.getTime() - this.startedAt.getTime();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user