You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@sling.apache.org by mp...@apache.org on 2018/10/17 14:23:12 UTC

[sling-org-apache-sling-distribution-core] branch master updated: SLING-7754: added some more logging

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

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


The following commit(s) were added to refs/heads/master by this push:
     new 6046e6d  SLING-7754: added some more logging
6046e6d is described below

commit 6046e6d7d1749e9818f719d0d06be0bc79b24c30
Author: Marius Petria <mp...@adobe.com>
AuthorDate: Wed Oct 17 16:09:44 2018 +0300

    SLING-7754: added some more logging
---
 .../queue/impl/resource/ResourceQueueCleanupTask.java             | 2 +-
 .../distribution/queue/impl/resource/ResourceQueueUtils.java      | 8 +++++---
 2 files changed, 6 insertions(+), 4 deletions(-)

diff --git a/src/main/java/org/apache/sling/distribution/queue/impl/resource/ResourceQueueCleanupTask.java b/src/main/java/org/apache/sling/distribution/queue/impl/resource/ResourceQueueCleanupTask.java
index f41b16e..7a13e2e 100644
--- a/src/main/java/org/apache/sling/distribution/queue/impl/resource/ResourceQueueCleanupTask.java
+++ b/src/main/java/org/apache/sling/distribution/queue/impl/resource/ResourceQueueCleanupTask.java
@@ -102,7 +102,7 @@ public class ResourceQueueCleanupTask implements Runnable {
                 continue;
             }
 
-            log.debug("removing empty folder {}", res.getPath());
+            log.debug("removing minute resource folder {}", res.getPath());
 
             resolver.delete(res);
             resolver.commit();
diff --git a/src/main/java/org/apache/sling/distribution/queue/impl/resource/ResourceQueueUtils.java b/src/main/java/org/apache/sling/distribution/queue/impl/resource/ResourceQueueUtils.java
index b221998..a54767e 100644
--- a/src/main/java/org/apache/sling/distribution/queue/impl/resource/ResourceQueueUtils.java
+++ b/src/main/java/org/apache/sling/distribution/queue/impl/resource/ResourceQueueUtils.java
@@ -228,11 +228,12 @@ public class ResourceQueueUtils {
      */
     private static Resource getOrCreateMinuteResource(Resource root) throws PersistenceException {
 
-        for (int i=0; i<2; i++) {
+        final int retries = 2;
+        for (int i=0; i < retries; i++) {
             try {
                 return tryGetOrCreateMinutes(root);
             } catch (PersistenceException e) {
-                log.warn("creating minute resource failed. retrying {} more times.", 5-i);
+                log.warn("creating minute resource failed. retrying {} more times.", retries-i);
             }
 
             root.getResourceResolver().revert();
@@ -260,9 +261,10 @@ public class ResourceQueueUtils {
         }
 
         for (int i=0; i < 3; i++) {
-            now.add(Calendar.MINUTE, i);
             String newMinutePath = getTimePath(now);
             Resource resource = createResource(root, newMinutePath);
+            log.debug("minute resource created {}", resource.getPath());
+            now.add(Calendar.MINUTE, 1);
         }
 
         resourceResolver.commit();