This is an automated email from the ASF dual-hosted git repository.

tmaret pushed a commit to branch master
in repository 
https://gitbox.apache.org/repos/asf/sling-org-apache-sling-distribution-journal.git


The following commit(s) were added to refs/heads/master by this push:
     new a89123a  SLING-9467 - Reference the PublisherConfigurationAvailable 
service to avoid running the task on instances that don't require it (#34)
a89123a is described below

commit a89123a980994e07ed64d4c58406118a51beda5e
Author: Timothee Maret <tma...@apache.org>
AuthorDate: Mon May 25 14:07:38 2020 +0200

    SLING-9467 - Reference the PublisherConfigurationAvailable service to avoid 
running the task on instances that don't require it (#34)
    
    SLING-9467 - Reference the PublisherConfigurationAvailable service to avoid 
running the task on instances that don't require it
---
 .../distribution/journal/impl/publisher/PackageCleanupTask.java    | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git 
a/src/main/java/org/apache/sling/distribution/journal/impl/publisher/PackageCleanupTask.java
 
b/src/main/java/org/apache/sling/distribution/journal/impl/publisher/PackageCleanupTask.java
index 80f8411..0cce80b 100644
--- 
a/src/main/java/org/apache/sling/distribution/journal/impl/publisher/PackageCleanupTask.java
+++ 
b/src/main/java/org/apache/sling/distribution/journal/impl/publisher/PackageCleanupTask.java
@@ -26,6 +26,7 @@ import static 
org.apache.sling.commons.scheduler.Scheduler.VALUE_RUN_ON_LEADER;
 
 import javax.annotation.ParametersAreNonnullByDefault;
 
+import 
org.apache.sling.distribution.journal.impl.shared.PublisherConfigurationAvailable;
 import org.osgi.service.component.annotations.Component;
 import org.osgi.service.component.annotations.Reference;
 import org.slf4j.Logger;
@@ -55,6 +56,12 @@ public class PackageCleanupTask implements Runnable {
     @Reference
     private PackageRepo packageRepo;
 
+    /**
+     * The task runs only when at least one DistributionSubscriber agent is 
configured.
+     */
+    @Reference
+    private PublisherConfigurationAvailable publisherConfigurationAvailable;
+
     @Override
     public void run() {
         LOG.info("Starting Package Cleanup Task");

Reply via email to