More bug fix and refactoring
[dmaap/datarouter.git] / datarouter-node / src / main / java / org / onap / dmaap / datarouter / node / Delivery.java
index 4675081..5931856 100644 (file)
@@ -66,7 +66,6 @@ public class Delivery {
         this.config = config;
         Runnable cmon = this::checkconfig;
         config.registerConfigTask(cmon);
-        checkconfig();
     }
 
     /**
@@ -168,7 +167,9 @@ public class Delivery {
                 }
             }
             try {
-                Files.delete(sxf.toPath());  // won't if anything still in it
+                if (sxf.list().length == 0) {
+                    Files.delete(sxf.toPath());  // won't if anything still in it
+                }
             } catch (IOException e) {
                 logger.error("Failed to delete file: " + sxf.getPath(), e);
             }