From fbaf445bf88347d14ace006333567bf0cd104264 Mon Sep 17 00:00:00 2001 From: Jan Oberhauser Date: Fri, 19 Jul 2019 09:47:41 +0200 Subject: [PATCH] :zap: Check again if workflow should be stopped after retry wait --- packages/core/src/WorkflowExecute.ts | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/packages/core/src/WorkflowExecute.ts b/packages/core/src/WorkflowExecute.ts index b8bd8512f..8bcad84cd 100644 --- a/packages/core/src/WorkflowExecute.ts +++ b/packages/core/src/WorkflowExecute.ts @@ -374,6 +374,7 @@ export class WorkflowExecute { for (let tryIndex = 0; tryIndex < maxTries; tryIndex++) { try { + if (tryIndex !== 0) { // Reset executionError from previous error try executionError = undefined; @@ -388,6 +389,13 @@ export class WorkflowExecute { } } + // Check again if the execution should be stopped else it + // could take forever to stop when each try takes a long time + if (this.activeExecutions.shouldBeStopped(this.executionId!) === true) { + // The execution should be stopped + break; + } + runExecutionData.resultData.lastNodeExecuted = executionData.node.name; nodeSuccessData = await workflow.runNode(executionData.node, JSON.parse(JSON.stringify(executionData.data)), runExecutionData, runIndex, this.additionalData, NodeExecuteFunctions, this.mode);