From bf5518f7869614b34dc8df2eb12301312618a2de Mon Sep 17 00:00:00 2001 From: Eva Vasques Date: Wed, 24 Jul 2024 19:26:49 +0100 Subject: [PATCH] MNT-24503 - FixedAclUpdater Job - Skip count if maxSize is set (#2809) (#2810) (cherry picked from commit a3f6e13a7c7c0b07f653ca700c74374bc67af951) --- .../repo/domain/permissions/FixedAclUpdater.java | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/repository/src/main/java/org/alfresco/repo/domain/permissions/FixedAclUpdater.java b/repository/src/main/java/org/alfresco/repo/domain/permissions/FixedAclUpdater.java index 10c249285f2..f8a6de44115 100644 --- a/repository/src/main/java/org/alfresco/repo/domain/permissions/FixedAclUpdater.java +++ b/repository/src/main/java/org/alfresco/repo/domain/permissions/FixedAclUpdater.java @@ -229,6 +229,11 @@ public List execute() throws Throwable int countNodesWithAspects() { + if (maxItems < DEFAULT_MAX_ITEMS) { + log.info("Job limited to process a maximum of " + maxItems + " Pending Acls"); + return maxItems; + } + final CountNodesWithAspectCallback countNodesCallback = new CountNodesWithAspectCallback(); int count = transactionService.getRetryingTransactionHelper() .doInTransaction(new RetryingTransactionCallback() @@ -240,12 +245,6 @@ public Integer execute() throws Throwable return countNodesCallback.getCount(); } }, false, true); - - if (count > maxItems) - { - log.info("Total nodes with pending acl: " + count + " Limiting work to " + maxItems); - return maxItems; - } return count; } }