fix: test

This commit is contained in:
aaaaaajie 2025-05-03 21:08:47 +08:00
parent 478d836404
commit 91f8da7aa1

View File

@ -150,6 +150,7 @@ export abstract class TaskType extends EventEmitter implements ITask {
if (error instanceof CancelError) {
this.statusChange({ type: 'cancelled' });
this.logger?.info(`Task ${this.taskId} was cancelled during execution`);
return;
} else {
this.status = {
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.emit('statusChange', this.status);
}
} finally {
this.fulfilledAt = new Date();
const duration = this.fulfilledAt.getTime() - this.startedAt.getTime();