From 2c2828aef110ed5c7735eadfd76a870845dc3ccc Mon Sep 17 00:00:00 2001 From: yuri1969 <1969yuri1969@gmail.com> Date: Sat, 16 Sep 2023 11:40:03 +0200 Subject: [PATCH] Do not use the `ExecutionRepository` --- .../io/kestra/core/runners/ExecutorService.java | 2 +- .../main/java/io/kestra/core/tasks/flows/Flow.java | 13 ++----------- 2 files changed, 3 insertions(+), 12 deletions(-) diff --git a/core/src/main/java/io/kestra/core/runners/ExecutorService.java b/core/src/main/java/io/kestra/core/runners/ExecutorService.java index de656bbf80a..f869302b945 100644 --- a/core/src/main/java/io/kestra/core/runners/ExecutorService.java +++ b/core/src/main/java/io/kestra/core/runners/ExecutorService.java @@ -579,7 +579,7 @@ private Executor handleFlowTask(final Executor executor) { ); try { - Execution execution = flowTask.createExecution(runContext, flowExecutorInterface()); + Execution execution = flowTask.createExecution(runContext, flowExecutorInterface(), executor.getExecution()); WorkerTaskExecution workerTaskExecution = WorkerTaskExecution.builder() .task(flowTask) diff --git a/core/src/main/java/io/kestra/core/tasks/flows/Flow.java b/core/src/main/java/io/kestra/core/tasks/flows/Flow.java index d6b17fd87e6..809477a095e 100644 --- a/core/src/main/java/io/kestra/core/tasks/flows/Flow.java +++ b/core/src/main/java/io/kestra/core/tasks/flows/Flow.java @@ -13,7 +13,6 @@ import io.kestra.core.models.flows.State; import io.kestra.core.models.tasks.RunnableTask; import io.kestra.core.models.tasks.Task; -import io.kestra.core.repositories.ExecutionRepositoryInterface; import io.kestra.core.runners.*; import io.swagger.v3.oas.annotations.media.Schema; import lombok.*; @@ -126,9 +125,8 @@ public String flowUidWithoutRevision() { } @SuppressWarnings("unchecked") - public Execution createExecution(RunContext runContext, FlowExecutorInterface flowExecutorInterface) throws Exception { + public Execution createExecution(RunContext runContext, FlowExecutorInterface flowExecutorInterface, Execution currentExecution) throws Exception { RunnerUtils runnerUtils = runContext.getApplicationContext().getBean(RunnerUtils.class); - ExecutionRepositoryInterface executionRepository = runContext.getApplicationContext().getBean(ExecutionRepositoryInterface.class); Map inputs = new HashMap<>(); if (this.inputs != null) { @@ -139,8 +137,7 @@ public Execution createExecution(RunContext runContext, FlowExecutorInterface fl List