From 84fd3b250dd1161ea06c5582fdadece4b29c2e53 Mon Sep 17 00:00:00 2001 From: xiaojunnuo Date: Wed, 16 Oct 2024 12:19:34 +0800 Subject: [PATCH] =?UTF-8?q?perf:=20=E4=BB=BB=E5=8A=A1=E4=B8=8B=E6=89=80?= =?UTF-8?q?=E6=9C=89=E6=AD=A5=E9=AA=A4=E9=83=BD=E8=B7=B3=E8=BF=87=E6=97=B6?= =?UTF-8?q?=EF=BC=8C=E6=95=B4=E4=B8=AA=E4=BB=BB=E5=8A=A1=E6=98=BE=E7=A4=BA?= =?UTF-8?q?=E8=B7=B3=E8=BF=87?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/core/pipeline/src/core/executor.ts | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/packages/core/pipeline/src/core/executor.ts b/packages/core/pipeline/src/core/executor.ts index 9e9c0ffbe..7b2256fc7 100644 --- a/packages/core/pipeline/src/core/executor.ts +++ b/packages/core/pipeline/src/core/executor.ts @@ -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) {