Expand `try`-`finally` scope of deleted accounts reconciliation lock
This commit is contained in:
parent
d0ccae129a
commit
db198237f3
|
@ -156,6 +156,7 @@ public class DeletedAccountsManager {
|
|||
|
||||
public void lockAndReconcileAccounts(final int max, final DeletedAccountReconciliationConsumer consumer) throws ChunkProcessingFailedException {
|
||||
final List<LockItem> lockItems = new ArrayList<>();
|
||||
try {
|
||||
final List<Pair<UUID, String>> reconciliationCandidates = deletedAccounts.listAccountsToReconcile(max).stream()
|
||||
.filter(pair -> {
|
||||
boolean lockAcquired = false;
|
||||
|
@ -188,7 +189,6 @@ public class DeletedAccountsManager {
|
|||
.filter(candidate -> numbersNeedingReconciliationAfterLock.contains(candidate.second()))
|
||||
.collect(Collectors.toList());
|
||||
|
||||
try {
|
||||
deletedAccounts.markReconciled(consumer.reconcile(accountsToReconcile));
|
||||
} finally {
|
||||
lockItems.forEach(
|
||||
|
|
Loading…
Reference in New Issue