This is an automated email from the ASF dual-hosted git repository.
bchapuis pushed a commit to branch 745-daylight
in repository https://gitbox.apache.org/repos/asf/incubator-baremaps.git
The following commit(s) were added to refs/heads/745-daylight by this push:
new abe1df3b Fix NoSuchElementException in workflow executor
abe1df3b is described below
commit abe1df3b9817f8d6e38ad16ec730089ca566ea79
Author: Bertil Chapuis <[email protected]>
AuthorDate: Mon Aug 28 13:51:34 2023 +0200
Fix NoSuchElementException in workflow executor
---
.../main/java/org/apache/baremaps/workflow/WorkflowExecutor.java | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git
a/baremaps-core/src/main/java/org/apache/baremaps/workflow/WorkflowExecutor.java
b/baremaps-core/src/main/java/org/apache/baremaps/workflow/WorkflowExecutor.java
index 2b3d3d05..6e0a1a77 100644
---
a/baremaps-core/src/main/java/org/apache/baremaps/workflow/WorkflowExecutor.java
+++
b/baremaps-core/src/main/java/org/apache/baremaps/workflow/WorkflowExecutor.java
@@ -208,13 +208,13 @@ public class WorkflowExecutor implements AutoCloseable {
var workflowStart = stepMeasures.stream()
.mapToLong(measures -> measures.stepMeasures.stream()
.mapToLong(measure -> measure.start)
- .min().getAsLong())
- .min().getAsLong();
+ .min().orElseGet(() -> 0L))
+ .min().orElseGet(() -> 0L);
var workflowEnd = stepMeasures.stream()
.mapToLong(measures -> measures.stepMeasures.stream()
.mapToLong(measure -> measure.end)
- .max().getAsLong())
- .max().getAsLong();
+ .max().orElseGet(() -> 0L))
+ .max().orElseGet(() -> 0L);
var workflowDuration = Duration.ofMillis(workflowEnd - workflowStart);
logger.info("Workflow graph: {}", this.graph);
logger.info(" Duration: {}", formatDuration(workflowDuration));