Skip to content

Commit

Permalink
Improve isAllInventoryTasksCompleted when all inventory task is empty (
Browse files Browse the repository at this point in the history
  • Loading branch information
azexcy authored Nov 2, 2023
1 parent 6a410d1 commit d9cf295
Showing 1 changed file with 3 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,9 @@ private static boolean isAllProgressesFilled(final int jobShardingCount, final C
}

private static boolean isAllInventoryTasksCompleted(final Collection<InventoryIncrementalJobItemProgress> jobItemProgresses) {
if (jobItemProgresses.stream().allMatch(each -> each.getInventory().getProgresses().isEmpty())) {
return false;
}
return jobItemProgresses.stream().flatMap(each -> each.getInventory().getProgresses().values().stream()).allMatch(each -> each.getPosition() instanceof FinishedPosition);
}
}

0 comments on commit d9cf295

Please sign in to comment.