fix(core): declare the FlowExecutor as a bean (#3389)

This commit is contained in:
Loïc Mathieu
2024-04-02 08:45:02 +02:00
committed by GitHub
parent 1ee6633ca4
commit 41ade3eb90
3 changed files with 2 additions and 5 deletions

View File

@@ -3,12 +3,14 @@ package io.kestra.core.runners;
import io.kestra.core.models.flows.Flow;
import io.kestra.core.repositories.FlowRepositoryInterface;
import io.kestra.core.services.FlowListenersInterface;
import jakarta.inject.Singleton;
import lombok.Setter;
import java.util.Collection;
import java.util.List;
import java.util.Optional;
@Singleton
public class DefaultFlowExecutor implements FlowExecutorInterface {
private final FlowRepositoryInterface flowRepositoryInterface;
@Setter

View File

@@ -22,7 +22,6 @@ import io.kestra.core.models.triggers.multipleflows.MultipleConditionStorageInte
import io.kestra.core.queues.QueueFactoryInterface;
import io.kestra.core.queues.QueueInterface;
import io.kestra.core.repositories.FlowRepositoryInterface;
import io.kestra.core.runners.DefaultFlowExecutor;
import io.kestra.core.runners.ExecutableUtils;
import io.kestra.core.runners.ExecutionQueued;
import io.kestra.core.runners.ExecutionRunning;
@@ -233,8 +232,6 @@ public class JdbcExecutor implements ExecutorInterface, Service {
Await.until(() -> this.allFlows != null, Duration.ofMillis(100), Duration.ofMinutes(5));
applicationContext.registerSingleton(new DefaultFlowExecutor(flowListeners, this.flowRepository));
this.executionQueue.receive(Executor.class, this::executionQueue);
this.workerTaskResultQueue.receive(Executor.class, this::workerTaskResultQueue);
this.killQueue.receive(Executor.class, this::killQueue);

View File

@@ -111,8 +111,6 @@ public class MemoryExecutor implements ExecutorInterface {
flowListeners.run();
flowListeners.listen(flows -> this.allFlows = flows);
applicationContext.registerSingleton(new DefaultFlowExecutor(flowListeners, this.flowRepository));
this.executionQueue.receive(MemoryExecutor.class, this::executionQueue);
this.workerTaskResultQueue.receive(MemoryExecutor.class, this::workerTaskResultQueue);
this.killQueue.receive(MemoryExecutor.class, this::killQueue);