BATCH-2630 - update not to rely on step execution order from DAO

This commit is contained in:
Cameron
2017-07-12 16:46:56 -04:00
parent 1b35bff3ec
commit 0506d3793e

View File

@@ -229,9 +229,12 @@ public class SimpleJobRepository implements JobRepository {
if (latest == null) {
latest = stepExecution;
}
// Ordered by step execution ID so less than or equal makes last step execution ID
// the tie breaker if start time is identical
if (latest.getStartTime().getTime() <= stepExecution.getStartTime().getTime()) {
if (latest.getStartTime().getTime() < stepExecution.getStartTime().getTime()) {
latest = stepExecution;
}
// Use step execution ID as the tie breaker if start time is identical
if (latest.getStartTime().getTime() == stepExecution.getStartTime().getTime() &&
latest.getId() < stepExecution.getId()) {
latest = stepExecution;
}
}