Skip to content

Commit

Permalink
fix(core): filter flowWithException in SchedulerEndpoint (#4439)
Browse files Browse the repository at this point in the history
  • Loading branch information
Skraye authored Jul 26, 2024
1 parent 7c9a329 commit b63fc43
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package io.kestra.core.endpoints;

import io.kestra.core.models.flows.FlowWithException;
import io.kestra.core.models.triggers.AbstractTrigger;
import io.kestra.core.models.triggers.Trigger;
import io.kestra.core.schedulers.AbstractScheduler;
Expand All @@ -14,7 +15,6 @@
import java.time.ZonedDateTime;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;

@Endpoint(id = "scheduler", defaultSensitive = false)
@Requires(property = "kestra.server-type", pattern = "(SCHEDULER|STANDALONE)")
Expand All @@ -28,6 +28,7 @@ public SchedulerEndpointResult running() {

List<SchedulerEndpointSchedule> result = scheduler.schedulerTriggers()
.stream()
.filter(flowWithTriggers -> !(flowWithTriggers.getFlow() instanceof FlowWithException))
.map(flowWithTrigger -> {
String uid = Trigger.uid(flowWithTrigger.getFlow(), flowWithTrigger.getAbstractTrigger());

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -376,7 +376,7 @@ public List<FlowWithTriggers> schedulerTriggers() {
.map(trigger ->
new FlowWithTriggers(
flows.get(trigger.flowUid()),
flows.get(trigger.flowUid()).getTriggers().stream().filter(t -> t.getId().equals(trigger.getTriggerId())).findFirst().orElse(null),
ListUtils.emptyOnNull(flows.get(trigger.flowUid()).getTriggers()).stream().filter(t -> t.getId().equals(trigger.getTriggerId())).findFirst().orElse(null),
trigger,
null,
null
Expand Down

0 comments on commit b63fc43

Please sign in to comment.