adamsaghy commented on code in PR #3255:
URL: https://github.com/apache/fineract/pull/3255#discussion_r1229619742
##########
fineract-provider/src/main/java/org/apache/fineract/cob/loan/LoanItemReader.java:
##########
@@ -56,7 +60,17 @@ public void beforeStep(@NotNull StepExecution stepExecution)
{
loanIds =
retrieveLoanIdService.retrieveAllNonClosedLoansByLastClosedBusinessDateAndMinAndMaxLoanId(loanCOBParameter,
customJobParameterResolver.getCustomJobParameterById(stepExecution,
LoanCOBConstant.IS_CATCH_UP_PARAMETER_NAME)
.map(Boolean::parseBoolean).orElse(false));
+
+ List<Long> lockedByCOBChunkProcessingAccountIds =
getLoanIdsLockedWithChunkProcessingLock(loanIds);
+ loanIds.retainAll(lockedByCOBChunkProcessingAccountIds);
}
setRemainingData(new ArrayList<>(loanIds));
}
+
+ private List<Long> getLoanIdsLockedWithChunkProcessingLock(List<Long>
loanIds) {
+ List<LoanAccountLock> accountLocks = new ArrayList<>();
+ accountLocks.addAll(loanLockingService.findAllByLoanIdIn(loanIds));
Review Comment:
You might wanna do the filtering at database side
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]