diff --git a/nifi/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/main/java/org/apache/nifi/controller/repository/FileSystemRepository.java b/nifi/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/main/java/org/apache/nifi/controller/repository/FileSystemRepository.java index e212bdbf38..3a03fad44e 100644 --- a/nifi/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/main/java/org/apache/nifi/controller/repository/FileSystemRepository.java +++ b/nifi/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/main/java/org/apache/nifi/controller/repository/FileSystemRepository.java @@ -193,11 +193,6 @@ public class FileSystemRepository implements ContentRepository { LOG.info("Initializing FileSystemRepository with 'Always Sync' set to {}", alwaysSync); initializeRepository(); - executor.scheduleWithFixedDelay(new BinDestructableClaims(), 1, 1, TimeUnit.SECONDS); - for (int i = 0; i < fileRespositoryPaths.size(); i++) { - executor.scheduleWithFixedDelay(new ArchiveOrDestroyDestructableClaims(), 1, 1, TimeUnit.SECONDS); - } - final long cleanupMillis; if (archiveCleanupFrequency == null) { cleanupMillis = 1000L; @@ -221,6 +216,15 @@ public class FileSystemRepository implements ContentRepository { @Override public void initialize(final ContentClaimManager claimManager) { this.contentClaimManager = claimManager; + + final NiFiProperties properties = NiFiProperties.getInstance(); + + final Map fileRespositoryPaths = properties.getContentRepositoryPaths(); + + executor.scheduleWithFixedDelay(new BinDestructableClaims(), 1, 1, TimeUnit.SECONDS); + for (int i = 0; i < fileRespositoryPaths.size(); i++) { + executor.scheduleWithFixedDelay(new ArchiveOrDestroyDestructableClaims(), 1, 1, TimeUnit.SECONDS); + } } @Override