dloy avatar dloy committed b877226

Change queueSleepSeconds to queueSleepMs

Comments (0)

Files changed (3)

fixity-src/src/main/java/org/cdlib/mrt/fixity/service/FixityServiceState.java

         setPeriodicReportFrequencyHours(prop.getProperty("periodicReportFrequency"));
         setPeriodicReportFrequencyHours(prop.getProperty("periodicReportFrequencyHours"));
         setPeriodicReportFormat(prop.getProperty("periodicReportFormat"));
-        setQueueSleepSeconds(prop.getProperty("queueSleep"));
-        setQueueSleepSeconds(prop.getProperty("queueSleepSeconds"));
+        setQueueSleep(prop.getProperty("queueSleep"));
+        setQueueSleepMs(prop.getProperty("queueSleepMs"));
     }
 
     /**
      * 
      * @return Number of seconds between the submission of each entry for processing
      */
-    public long getQueueSleepSeconds() {
+    public long getQueueSleepMs() {
         return queueSleep;
     }
 
-    public void setQueueSleepSeconds(long queueSleep) {
+    public void setQueueSleepMs(long queueSleep) {
         this.queueSleep = queueSleep;
     }
 
 
-    public void setQueueSleepSeconds(String queueSleepS) {
+    public void setQueueSleepMs(String queueSleepS) {
         if (StringUtil.isEmpty(queueSleepS)) return;
         this.queueSleep = Long.parseLong(queueSleepS);
     }
+
+
+    // seconds
+    public void setQueueSleep(String queueSleepS) {
+        if (StringUtil.isEmpty(queueSleepS)) return;
+        this.queueSleep = (Long.parseLong(queueSleepS) * 1000);
+    }
 }

fixity-src/src/main/java/org/cdlib/mrt/fixity/service/FixityState.java

             FixityServiceState state = new FixityServiceState(serviceProperties);
             setIntervalDays(state.getIntervalDays());
             setThreadPool(state.getThreadPool());
-            setQueueSleepSeconds(state.getQueueSleepSeconds());
+            setQueueSleepMs(state.getQueueSleepMs());
             setNotification(state.getNotification());
             setPeriodicReportFormat(state.getPeriodicReportFormat());
             setSupportURI(state.getSupportURI());
         return cnt.get();
     }
 
-    public long getQueueSleepSeconds() {
+    public long getQueueSleepMs() {
         return queueSleep;
     }
 
      * Service state queueSleep is in increments of seconds - convert to milliseconds before storing
      * @param queueSleep
      */
-    public synchronized void setQueueSleepSeconds(long queueSleep) {
+    public synchronized void setQueueSleepMs(long queueSleep) {
         this.queueSleep = queueSleep;
     }
 

fixity-src/src/main/java/org/cdlib/mrt/fixity/service/RunFixity.java

         try {
             if (!fixityState.isRunFixity()) return;
 
-            long queueSleep = fixityState.getQueueSleepSeconds();
+            long queueSleep = fixityState.getQueueSleepMs();
             if (queueSleep > 0) {
-                long queueSleepMilleseconds = queueSleep * 1000;
+                long queueSleepMilleseconds = queueSleep;
                 log("sleepInterval - "
                     + " - queueSleep=" + queueSleep
                     + " - queueSleepMilleseconds=" + queueSleepMilleseconds
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.