Skip to content

Commit c2a4bf6

Browse files
committed
Fix last step execution retrieval in MongoStepExecutionDao
Resolves spring-projects-experimental/spring-batch-experimental#3
1 parent ffe3687 commit c2a4bf6

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

spring-batch-core/src/main/java/org/springframework/batch/core/repository/dao/MongoStepExecutionDao.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,7 @@ public StepExecution getLastStepExecution(JobInstance jobInstance, String stepNa
111111
// first one
112112
Optional<org.springframework.batch.core.repository.persistence.StepExecution> lastStepExecution = stepExecutions
113113
.stream()
114+
.filter(stepExecution -> stepExecution.getName().equals(stepName))
114115
.min(Comparator
115116
.comparing(org.springframework.batch.core.repository.persistence.StepExecution::getCreateTime)
116117
.thenComparing(org.springframework.batch.core.repository.persistence.StepExecution::getId));

0 commit comments

Comments
 (0)