Skip to content

Commit

Permalink
fix(kafka-runner): we always need to wait for the flow for new create…
Browse files Browse the repository at this point in the history
…d flow
  • Loading branch information
tchiotludo committed Oct 12, 2022
1 parent fd8405d commit 744b86e
Showing 1 changed file with 5 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -73,16 +73,11 @@ public Executor joinFlow(Executor executor, Boolean withDefaults) {

try {
// pooling of new flow can be delayed on ExecutorStore, we maybe need to wait that the flow is updated
if (!flowExecutorInterface.isReady()) {
flow = Await.until(
() -> flowExecutorInterface.findByExecution(executor.getExecution()).orElse(null),
Duration.ofMillis(100),
Duration.ofMinutes(5)
);
} else {
flow = flowExecutorInterface.findByExecution(executor.getExecution())
.orElseThrow(() -> new TimeoutException("Unable to find flow with flow executor ready"));
}
flow = Await.until(
() -> flowExecutorInterface.findByExecution(executor.getExecution()).orElse(null),
Duration.ofMillis(100),
Duration.ofMinutes(5)
);
} catch (TimeoutException e) {
// execution is failed, can't find flow, avoid recursive exception, skipped it.
if (executor.getExecution().getState().isFailed()) {
Expand Down

0 comments on commit 744b86e

Please sign in to comment.