adamsaghy commented on code in PR #3255:
URL: https://github.com/apache/fineract/pull/3255#discussion_r1235337207


##########
fineract-provider/src/main/java/org/apache/fineract/cob/loan/ApplyLoanLockTasklet.java:
##########
@@ -66,16 +76,36 @@ public RepeatStatus execute(@NotNull StepContribution 
contribution, @NotNull Chu
         List<LoanAccountLock> accountLocks = new ArrayList<>();
         loanIdPartitions.forEach(loanIdPartition -> 
accountLocks.addAll(loanLockingService.findAllByLoanIdIn(loanIdPartition)));
 
-        List<Long> alreadyLockedByChunkProcessingAccountIds = 
accountLocks.stream()
-                .filter(e -> 
LockOwner.LOAN_COB_CHUNK_PROCESSING.equals(e.getLockOwner())).map(LoanAccountLock::getLoanId).toList();
-
         List<Long> toBeProcessedLoanIds = new ArrayList<>(loanIds);
-        
toBeProcessedLoanIds.removeAll(alreadyLockedByChunkProcessingAccountIds);
+        List<Long> alreadyLockedAccountIds = 
accountLocks.stream().map(LoanAccountLock::getLoanId).toList();
+
+        toBeProcessedLoanIds.removeAll(alreadyLockedAccountIds);
+        try {
+            applyLocks(toBeProcessedLoanIds);
+        } catch (Exception e) {
+            if (++numberOfExecutions > NUMBER_OF_RETRIES) {

Review Comment:
   I think we dont need this. The commit count got increased with each 
execution. 



-- 
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]

Reply via email to