perf: 任务下所有步骤都跳过时,整个任务显示跳过

pull/229/head
xiaojunnuo 2024-10-16 12:19:34 +08:00
parent 7d9183d022
commit 84fd3b250d
1 changed files with 12 additions and 6 deletions

View File

@ -155,8 +155,8 @@ export class Executor {
for (const task of stage.tasks) {
const runner = async () => {
return this.runWithHistory(task, "task", async () => {
await this.runTask(task);
return ResultType.success;
const res = await this.runTask(task);
return res;
});
};
runnerList.push(runner);
@ -178,16 +178,22 @@ export class Executor {
return this.compositionResultType(resList);
}
compositionResultType(resList: ResultType[]) {
compositionResultType(resList: ResultType[]): ResultType {
let hasSuccess = false;
let hasSkip = false;
for (const type of resList) {
if (type === ResultType.error) {
return ResultType.error;
}
if (type === ResultType.success) {
} else if (type === ResultType.success) {
hasSuccess = true;
} else if (type === ResultType.skip) {
hasSkip = true;
}
}
if (!hasSuccess && hasSkip) {
//全是跳过
return ResultType.skip;
}
if (hasSuccess) {
return ResultType.success;
}
@ -254,7 +260,7 @@ export class Executor {
let inputChanged = true;
const lastInputHash = lastNode?.status?.inputHash;
if (lastInputHash && newInputHash && lastInputHash === newInputHash) {
//参数有变化
//参数有变化
inputChanged = false;
}
if (step.strategy?.runStrategy === RunStrategy.SkipWhenSucceed) {