1. merritt
  2. Untitled project
  3. mrt-fixity

Commits

dloy  committed b2f9187

fixes for dp01 handling - empty database

  • Participants
  • Parent commits 6204ba9
  • Branches default

Comments (0)

Files changed (1)

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

View file
  • Ignore whitespace
         }
     }
 
-    protected void addSQLEntries()
+    protected int addSQLEntries()
         throws TException
     {
         Connection connection = null;
                     + "order by verified "
                     + "limit " + capacity + ";";
             Properties [] props = FixityDBUtil.cmd(connection, sql, logger);
+            if ((props == null) || (props.length==0)) return 0;
             for (Properties propEntry : props) {
                 if (!fixityState.isRunFixity()) break;
                 FixityEntry entry = new FixityEntry(propEntry);
                 log(entry.dump("ADD"));
             }
             log("END ADD");
+            return props.length;
 
         } catch (TException fe) {
             throw fe;
         throws TException
     {
         try {
-            addSQLEntries();
+            if (addSQLEntries() == 0) {
+                log("No ITEM content - sleep 30 seconds");
+                Thread.sleep(30000);
+                return;
+            };
             log("Thread pool count:" + fixityState.getThreadPool());
             if (!fixityState.isRunFixity()) return;
             ExecutorService threadPool