From 089a27f227afac1bff960d0b8cc0f31d206156d2 Mon Sep 17 00:00:00 2001 From: danbress Date: Mon, 8 Jun 2015 22:06:23 -0400 Subject: [PATCH] NIFI-632 moving thread start to init method --- .../repository/FileSystemRepository.java | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) 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